for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace jeremykenedy\LaravelRoles\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
use jeremykenedy\LaravelRoles\Contracts\RoleHasRelations as RoleHasRelationsContract;
use jeremykenedy\LaravelRoles\Database\Database;
use jeremykenedy\LaravelRoles\Traits\RoleHasRelations;
use jeremykenedy\LaravelRoles\Traits\Slugable;
class Role extends Database implements RoleHasRelationsContract
{
use RoleHasRelations;
use Slugable;
use SoftDeletes;
/**
* The attributes that are not mass assignable.
*
* @var array
*/
protected $guarded = [
'id',
];
* The attributes that should be mutated to dates.
protected $dates = [
'created_at',
'updated_at',
'deleted_at',
* The attributes that are mass assignable.
protected $fillable = [
'name',
'slug',
'description',
'level',
* Typecast for protection.
protected $casts = [
'id' => 'integer',
'name' => 'string',
'slug' => 'string',
'description' => 'string',
'level' => 'integer',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
* Indicates if the model should be timestamped.
* @var bool
public $timestamps = true;
* Create a new model instance.
* @param array $attributes
public function __construct(array $attributes = [])
parent::__construct($attributes);
$this->table = config('roles.rolesTable');
}