[英]Laravel Fortify Route Prefix
I want to set admin
prefix to all laravel fortify routes.我想为所有 Laravel 强化路由设置
admin
前缀。
Prior to 8.*
, putting Auth::routes()
inside route admin
prefix group works fine.在
8.*
之前,将Auth::routes()
放在路由admin
前缀组中可以正常工作。 Since I don't want to use laravel/ui
in my 8.*
application, I eager to know how can I add prefix in fortify routes.由于我不想在我的
8.*
应用程序中使用laravel/ui
,我很想知道如何在强化路由中添加前缀。
I added that line in fortify.php
:我在
fortify.php
添加了这一行:
'prefix' => 'admin'
But that didn't work.但这没有用。 How can I solve it?
我该如何解决?
You're almost there.您快到了。 In your
config\\fortify.php
file:在您的
config\\fortify.php
文件中:
Replace代替
'prefix' => 'admin'
with和
'path' => 'admin'
Confirm it has worked using the console command php artisan route:list
.使用控制台命令
php artisan route:list
确认它已经工作。 You might need to clear your cached routes afterwards.之后您可能需要清除缓存的路由。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.