gpt4 book ai didi

php - 使用前缀的 Laravel 5 路由

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:43:59 24 4
gpt4 key购买 nike

您好,我正在构建一个 Laravel 5 项目,该项目将部署在 wordpress 应用程序内服务器上的子文件夹中(我不知道为什么,但客户端是客户端),然后我需要为所有路由添加前缀带有“/es”前缀的应用程序,现在问题出在与 Auth 相关的路由上。在我的路线定义中,我有以下行:

Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController',
]);

我的问题是,有没有什么方法可以为这个路由添加前缀,而不必为从处理它们的特征中提取的 auth Controller 放置所有路由定义?

提前致谢。

最佳答案

您可以使用路由前缀:http://laravel.com/docs/5.1/routing#route-group-prefixes

The prefix group array attribute may be used to prefix each route in the group with a given URI.

关于php - 使用前缀的 Laravel 5 路由,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34373976/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com