I have a simple Gate in AuthServiceProvider:
public function boot()
{
$this->registerPolicies();
Gate::define('test', function (User $user) {
return true;
});
}
Then I'm trying to test it on web.php:
Route::get('/', function () {
return view('welcome');
})->middleware('can:test')
but it redirects me to the unauthorized page, why?
The User model exists, but I just return true anyway