app/Providers/AuthServiceProvider.php
/**
     * Register any authentication / authorization services.
     *
     * @return void
     */
Register any authentication / authorization services.
@return void
Register any authentication / authorization services . @return void
public function boot()
    {
        $this->registerPolicies();
        Gate::define('isAdmin', function($user){
            return $user->user_type == 'admin';
        });
        Gate::define('isFuncionario', function($user){
            return $user->user_type == 'funcionario';
        });
    }
public function boot ( ) { $ this -> registerPolicies ( ) ; Gate :: define ( 'isAdmin' , function ( $ user ) { return $ user -> user_type == 'admin' ; } ) ; Gate :: define ( 'isFuncionario' , function ( $ user ) { return $ user -> user_type == 'funcionario' ; } ) ; }
Register any authentication / authorization services.
Register any authentication / authorization services .
//Checa se for Admin //Retorna verdadeiro se o auth user type for  admin //Checa se for Funcionário //Retorna verdadeiro se o auth user type for funcionário