本文介绍了在Laravel JetStream中添加路由前缀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何为Laravel JetStream公开的身份验证路由添加路由前缀?例如,我想将默认的/login
路由移动到/api/login
(以及类似的/register
和/logout
路线).我可以通过config选项来执行此Passport,但是JetStream中似乎没有这样的东西.
How do I add a route prefix to authentication routes exposed by Laravel JetStream? For example, I want to move the default /login
route to /api/login
(and similarly /register
and /logout
routes). I could do this Passport through a config option, but no such things appears to be there in JetStream.
推荐答案
有一个简单的解决方案,但未记录.您只需要转到您的fortify.php配置文件并添加路径.像:
there is a simple solution but its undocumented. you just have to go to your fortify.php config file and add a path. like:
return [
.
.
.
'path' => 'api',
// rest of your config
];
这篇关于在Laravel JetStream中添加路由前缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!