From 470093ff2890f86badf40a41dcd525954010016e Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 24 Apr 2025 16:17:06 +0200 Subject: [PATCH] Fix should->applies --- src/Policies/ControlledPolicy.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Policies/ControlledPolicy.php b/src/Policies/ControlledPolicy.php index 0e3b0f0..c5c4556 100644 --- a/src/Policies/ControlledPolicy.php +++ b/src/Policies/ControlledPolicy.php @@ -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())); } /** @@ -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); } /** @@ -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())); } /** @@ -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); } /** @@ -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); } /** @@ -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); } /** @@ -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); } }