Recently Laravel Pulse was released and yesterday I installed it. The problem I have is that I can't protect the route correctly.
I followed the documentation and added the Gate in the AuthServiceProvider, but it's not working, I can access it anyway no matter what, it's like it never accesses that part of the code.
Also, I don't know how it works the fact that it is the path /pulse where the Dashboard is rendered, how/where can I change that?
What can it be?
This is how my AuthServiceProvider looks like:
*/
protected $policies = [
// 'App\Models\Model' => 'App\Policies\ModelPolicy',
];
/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot(): void
{
Gate::define('viewPulse', function (User $user) {
return in_array($user->email, [
'dev@as.com'
]);
});
$this->registerPolicies();
}
}