app/Providers/AuthServiceProvider.php
/**
     * Register any application authentication / authorization services.
     *
     * @param  \Illuminate\Contracts\Auth\Access\Gate  $gate
     * @return void
     */
Register any application authentication / authorization services.
Register any application authentication / authorization services .
public function boot(GateContract $gate)
    {
        $this->registerPolicies($gate);
        $gate->define('admin',function(User $user){
            return $user->email === 'marcoperafan@gmail.com';
        });
        $gate->define('view-posts',function(User $user){
            return true;
        });
    }
public function boot ( GateContract $ gate ) { $ this -> registerPolicies ( $ gate ) ; $ gate -> define ( 'admin' , function ( User $ user ) { return $ user -> email === 'marcoperafan@gmail.com' ; } ) ; $ gate -> define ( 'view-posts' , function ( User $ user ) { return true ; } ) ; }
Register any application authentication / authorization services.
Register any application authentication / authorization services .