php - How to add a user-defined policy in laravel -


i know laravel has pre-defined policy methods create, update, delete , view, question how can create 1 , use in program? i've tried define method in policy file, , call in controller, didn't work, , report 403 forbidden error. bellow did:

//a method in userpolicy.php file public function get(user $user, user $target){     return true; } 

and called in usercontroller.php

$this->authorize('get', $user, user::class); 

it won't work in anyway.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -