laravel 路由别名问题

路由代码:
Route::any('index/test',[
    'user' => 'IndexController@test',
    'as' => 'test'
]);
控制器代码:
public function test()
{
    return route('test');
}

访问地址:http://localhost/laravel/public/index/test

这样是可以的:

Route::any('index/test','IndexController@test')->name('test');
pencil115
浏览 1798回答 1
1回答

pencil115

已经找到问题了,是uses,不是user
打开App,查看更多内容
随时随地看视频慕课网APP