0
Hello, I need to pass several defines for a route, for example admin, annual plan, and new-user, when I put can in middleware it only identifies the first parameter.
Authserviceprovider.php
Gate::define("new-user","App\Policies\ACLChecker@checkerNewUser");
Gate::define("plano-anual","App\Policies\ACLChecker@checkerPlanoAnual");
Gate::define("admin","App\Policies\ACLChecker@checkerAdmin");
web php.
Route::get('/home', 'HomeController@index')->middleware("can:plano-anual,new-user,admin");
Debug:
Gate::after(function ($user, $ability, $result, $arguments) {
//
dd($user->plano, $ability, $result, $arguments);
});
Mano o can on the route works like this,the first is the name of the action we want to authorize and the second is the route parameter we wish to pass to the policy method.
– Joan Marcos
I need to have control of these categories in the layout, is there another way to make them? @Joanmarcos
– Fernando Santana
More to lock user who does not make payment.
– Fernando Santana