根据Laravel文档的理解,它用于重定向,但我可能是错误的。
我写了
之间是否有区别。
我写了
Route::get('user/profile', ['as' => 'profile', function () {
echo 'some_text';
}]);
然后我期望我的URL从https://base_url/public/index.php/user/profile
重定向到https://base_url/public/index.php/profile
,但它没有发生。总的来说,我想知道,如果我使用 与之间是否有区别。
Route::get('user/profile', function () {
echo 'some_text';
});
使用上述路由规则的替代方法。
as
关键字在 Laravel 文档的哪里有记录? - Istiaque Ahmedas
,如果您将文档更改为5.2版本,则可以看到。在更新的版本中,它是->name
。 - Nicklas Kevin Frankname()
方法,对吧? - Eyad Mohammed Osama