Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel gate and policies

/**

 * Create a new controller instance.

 *

 * @return void

 */

public function delete()

{

    if (Gate::denies('isAdmin')) {

        dd('You are not admin');

    } else {

        dd('Admin allowed');

    }

}
Source by www.itsolutionstuff.com #
 
PREVIOUS NEXT
Tagged: #laravel #gate #policies
ADD COMMENT
Topic
Name
4+4 =