vendredi 28 septembre 2018

Call to undefined method Illuminate\Support\Facades\Gate::define()

I am using Policy in Laravel 5.6

But getting this Error:

Call to undefined method Illuminate\Support\Facades\Gate::define()

How can I resolve this problem?

protected $policies = [
        'App\Model' => 'App\Policies\ModelPolicy',
    ];

and in boot:

public function boot(GateContract $gate)
{
        $this->registerPolicies();

        $gate->define('isAdmin', function ($user){
            return $user->role == 1;
        });
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire