*/
public function permissions(): MorphMany
{
- return $this->morphMany(EntityPermission::class, 'restrictable');
+ return $this->morphMany(EntityPermission::class, 'entity');
}
/**
{
return $this->permissions()
->where('role_id', '=', $role_id)
- ->where('action', '=', $action)
+ ->where($action, '=', true)
->count() > 0;
}