我在 Laravel 中使用 Horizon 和 web 套接字。如何只允许管理员访问这两项服务?我只需要为此创建一个新的中间件吗?
例子:
/*
* Dashboard Routes Middleware
*
* These middleware will be assigned to every dashboard route, giving you
* the chance to add your own middleware to this list or change any of
* the existing middleware. Or, you can simply stick with this list.
*/
'middleware' => [
'web',
Authorize::class,
],