[英]How to add custom middleware to Laravel Nova
I am not 100% expert with Laravel routes, so I am finding some issues trying to accomplish the following:我不是 Laravel 路线的 100% 专家,所以我发现一些问题试图完成以下任务:
I've googled around and found no similar question/issue.我用谷歌搜索并没有发现类似的问题/问题。 Anyone can give me an enlighting example?
谁能给我一个启发性的例子?
Thanks in advance.提前致谢。
I found the place while looking at another post here.我在这里看另一个帖子时找到了这个地方。 What I was missing was to declare my token validator class in config/nova.php
我缺少的是在 config/nova.php 中声明我的令牌验证器 class
Here:这里:
`/*
|--------------------------------------------------------------------------
| Nova Route Middleware
|--------------------------------------------------------------------------
|
| These middleware will be assigned to every Nova route, giving you the
| chance to add your own middleware to this stack or override any of
| the existing middleware. Or, you can just stick with this stack.
|
*/
'middleware' => [
'web',
Authenticate::class,
DispatchServingNovaEvent::class,
BootTools::class,
Authorize::class,
HereShouldGoMyClass::class,
],`
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.