Horizon Gate not work. 5.23
David-Grass-Feria opened this issue · comments
Horizon Version
5.23
Laravel Version
10.10
PHP Version
8.2.15
Redis Driver
Predis
Redis Version
2.2
Database Driver & Version
Mysql
Description
- composer require laravel/horizon
- php artisan horizon:install
- /app/providers/horizonServiceProvider
protected function gate(): void
{
Gate::define('viewHorizon', function ($user) {
return in_array($user->id, [
1
]);
});
}
- APP_ENV=production
Anyone can open "http://localhost/horizon/dashboard". Even guests who are not logged in. Only the user with ID 1 should have access.
Steps To Reproduce
I dont know where the error is. But i think your Gate::authorize not work.
Hi there,
Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels:
However, this issue will not be locked and everyone is still free to discuss solutions to your problem!
Thanks.