Skip to content

Commit d2e26e0

Browse files
authored
Update example override policy
1 parent f30b5a0 commit d2e26e0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,13 @@ Adding any of the `before`, `create`, `edit`, `view`, `inspect`, and `remove`
221221
use App\MyModel;
222222
use App\User;
223223
use GeneaLabs\LaravelGovernor\Policies\LaravelGovernorPolicy;
224+
use Illuminate\Auth\Access\HandlesAuthorization;
224225

225226
class MyModelPolicy extends LaravelGovernorPolicy
226227
{
227-
public function before($user)
228+
use HandlesAuthorization;
229+
230+
public function before(User $user)
228231
{
229232
return $user->isSuperAdmin ? true : null;
230233
}

0 commit comments

Comments
 (0)