33 lines
521 B
PHP
33 lines
521 B
PHP
<?php
|
|
|
|
namespace Webkul\User\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Webkul\User\Models\Admin;
|
|
|
|
class Role extends Model
|
|
{
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'name', 'description', 'permission_type', 'permissions',
|
|
];
|
|
|
|
protected $casts = [
|
|
'permissions' => 'array'
|
|
];
|
|
|
|
/**
|
|
* Get the admins.
|
|
*/
|
|
public function admins()
|
|
{
|
|
return $this->hasMany(Admin::class);
|
|
}
|
|
|
|
}
|