diff --git a/src/Models/Permission.php b/src/Models/Permission.php index 4b408bb..0b33ee4 100644 --- a/src/Models/Permission.php +++ b/src/Models/Permission.php @@ -4,11 +4,10 @@ use Illuminate\Database\Eloquent\Model; -class Permission extends Model +class Role extends Model { protected $fillable = [ - 'name', - 'description' + 'name' ]; protected $hidden = [ @@ -17,4 +16,14 @@ class Permission extends Model 'updated_at', 'pivot' ]; + + /** + * Get permissions that are linked to this role + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany + */ + public function permissions() + { + return $this->belongsToMany(Permission::class); + } }