路由代码: 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