so you want only nova admins to access the pulse route? given your viewPulse returns true can you access the pulse route via a non admin user?
Laravel pulse does not work with specific guard different than the default guard
I tried to report the issue on github, but my issue was closed in like 2 hours and the response was: Try another sites for answers. Did I do something wrong? Here is my problem:
I have a different guard for my admins. My guard is not the default guard.
`'defaults' => [ 'guard' => 'web', 'passwords' => 'users', ],
/* |--------------------------------------------------------------------------
Authentication Guards Next, you may define every authentication guard for your application. Of course, a great default configuration has been defined for you here which uses session storage and the Eloquent user provider. All authentication drivers have a user provider. This defines how the users are actually retrieved out of your database or other storage mechanisms used by this application to persist your user's data. Supported: "session" */'guards' => [ 'web' => [ 'driver' => 'session', 'provider' => 'users', ], 'admins' => [ 'driver' => 'session', 'provider' => 'admins', ], ],`
My guard is using a custom model named AdminUser instead of User. If I set up in AuthServiceProvider:
Gate::define('viewPulse', function () { return true; });
I receive 403 no matter what because I have a different guard for my admins and laravel pulse does not see that I'm logged in.
Also I use laravel nova for my admins.
I think the solution is to make the guard used for laravel pulse configurable in config/pulse.php
Steps To Reproduce Create a new guard: 'admins' => [ 'driver' => 'session', 'provider' => 'admins', ],
Create a new provider for your guard: 'admins' => [ 'driver' => 'eloquent', 'model' => App\Models\AdminUser::class, ],
Install laravel nova and change the default guard.
Log in into nova as admin
Add in AuthServiceProvider: Gate::define('viewPulse', function () { return true; });
Try to access laravel pulse. You will receive 403
Please or to participate in this conversation.