laravel / horizon

Dashboard and code-driven configuration for Laravel queues.
https://laravel.com/docs/horizon
MIT License
3.88k stars 658 forks source link

If using sanctum how to authorization? #1440

Closed ouronghuang closed 6 months ago

ouronghuang commented 6 months ago

If using Sanctum API Token Authentication(https://laravel.com/docs/10.x/sanctum#api-token-authentication) how to authorization?

// How to carry token to obtain users
Gate::define('viewHorizon', function ($user) {
    return in_array($user->email, [
    //
    ]);
});
crynobone commented 6 months ago

Hi there,

Thanks for reporting the problem you are encountering, but it looks like this is a question which may be better suited for a support channel. We 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 repository 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.