| @@ 10-34 (lines=25) @@ | ||
| 7 | use Ultraware\Roles\Traits\PermissionHasRelations; |
|
| 8 | use Ultraware\Roles\Traits\Slugable; |
|
| 9 | ||
| 10 | class Permission extends Model implements PermissionHasRelationsContract |
|
| 11 | { |
|
| 12 | use Slugable, PermissionHasRelations; |
|
| 13 | ||
| 14 | /** |
|
| 15 | * The attributes that are mass assignable. |
|
| 16 | * |
|
| 17 | * @var array |
|
| 18 | */ |
|
| 19 | protected $fillable = ['name', 'slug', 'description', 'model']; |
|
| 20 | ||
| 21 | /** |
|
| 22 | * Create a new model instance. |
|
| 23 | * |
|
| 24 | * @param array $attributes |
|
| 25 | */ |
|
| 26 | public function __construct(array $attributes = []) |
|
| 27 | { |
|
| 28 | parent::__construct($attributes); |
|
| 29 | ||
| 30 | if ($connection = config('roles.connection')) { |
|
| 31 | $this->connection = $connection; |
|
| 32 | } |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||
| @@ 10-34 (lines=25) @@ | ||
| 7 | use Ultraware\Roles\Traits\RoleHasRelations; |
|
| 8 | use Ultraware\Roles\Traits\Slugable; |
|
| 9 | ||
| 10 | class Role extends Model implements RoleHasRelationsContract |
|
| 11 | { |
|
| 12 | use Slugable, RoleHasRelations; |
|
| 13 | ||
| 14 | /** |
|
| 15 | * The attributes that are mass assignable. |
|
| 16 | * |
|
| 17 | * @var array |
|
| 18 | */ |
|
| 19 | protected $fillable = ['name', 'slug', 'description', 'level', 'parent_id']; |
|
| 20 | ||
| 21 | /** |
|
| 22 | * Create a new model instance. |
|
| 23 | * |
|
| 24 | * @param array $attributes |
|
| 25 | */ |
|
| 26 | public function __construct(array $attributes = []) |
|
| 27 | { |
|
| 28 | parent::__construct($attributes); |
|
| 29 | ||
| 30 | if ($connection = config('roles.connection')) { |
|
| 31 | $this->connection = $connection; |
|
| 32 | } |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||