AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
# 命名路由 命名路由让你更方便于产生 URL 与重定向特定路由。您可以用 as 的数组键值指定名称给路由: ``` Route::get('user/profile', ['as' => 'profile', function() { // }]); ``` 也可以为控制器动作指定路由名称: ``` Route::get('user/profile', [ 'as' => 'profile', 'uses' => 'UserController@showProfile' ]); ``` 现在你可以使用路由名称产生 URL 或进行重定向: ``` $url = route('profile'); $redirect = redirect()->route('profile'); currentRouteName 方法会返回目前请求的路由名称: $name = Route::currentRouteName(); ```