Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/Policies/ControlledPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected function getControl(): Control
*/
public function viewAny(Model $user)
{
return $this->getControl()->should($user, __FUNCTION__, new ($this->getModel()));
return $this->getControl()->applies($user, __FUNCTION__, new ($this->getModel()));
}

/**
Expand All @@ -58,7 +58,7 @@ public function viewAny(Model $user)
*/
public function view(Model $user, Model $model)
{
return $this->getControl()->should($user, __FUNCTION__, $model);
return $this->getControl()->applies($user, __FUNCTION__, $model);
}

/**
Expand All @@ -70,7 +70,7 @@ public function view(Model $user, Model $model)
*/
public function create(Model $user)
{
return $this->getControl()->should($user, __FUNCTION__, new ($this->getModel()));
return $this->getControl()->applies($user, __FUNCTION__, new ($this->getModel()));
}

/**
Expand All @@ -83,7 +83,7 @@ public function create(Model $user)
*/
public function update(Model $user, Model $model)
{
return $this->getControl()->should($user, __FUNCTION__, $model);
return $this->getControl()->applies($user, __FUNCTION__, $model);
}

/**
Expand All @@ -96,7 +96,7 @@ public function update(Model $user, Model $model)
*/
public function delete(Model $user, Model $model)
{
return $this->getControl()->should($user, __FUNCTION__, $model);
return $this->getControl()->applies($user, __FUNCTION__, $model);
}

/**
Expand All @@ -109,7 +109,7 @@ public function delete(Model $user, Model $model)
*/
public function restore(Model $user, Model $model)
{
return $this->getControl()->should($user, __FUNCTION__, $model);
return $this->getControl()->applies($user, __FUNCTION__, $model);
}

/**
Expand All @@ -122,6 +122,6 @@ public function restore(Model $user, Model $model)
*/
public function forceDelete(Model $user, Model $model)
{
return $this->getControl()->should($user, __FUNCTION__, $model);
return $this->getControl()->applies($user, __FUNCTION__, $model);
}
}