PHP Trait App\Traits\PermissionHasUsersTrait

Show file Open project: sroutier/laravel-5.1-enterprise-starter-kit

Public Methods

Method Description
boot ( ) : void | boolean Boot the permission model Attach event listener to remove the many-to-many records when trying to delete Will NOT delete any records if the permission model uses soft deletes.
getIsUsedByUserAttribute ( ) : boolean
hasUser ( $userName ) : boolean
users ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany Many-to-Many relations with user model.

Method Details

boot() public static method

Boot the permission model Attach event listener to remove the many-to-many records when trying to delete Will NOT delete any records if the permission model uses soft deletes.
public static boot ( ) : void | boolean
return void | boolean

getIsUsedByUserAttribute() public method

hasUser() public method

public hasUser ( $userName ) : boolean
$userName
return boolean

users() public method

Many-to-Many relations with user model.
public users ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany
return Illuminate\Database\Eloquent\Relations\BelongsToMany