laravel 控制器多个方法共用一个路由

Route::get('Index/{action}', function(App\Http\Controllers\IndexController $index, $action){
    return $index->$action();
});
https://xueyuanjun.com/post/5866.html

 

注册一个可以响应任何HTTP动作的路由

代码如下:

Route::any('foo', function()
{
    return 'Hello World';
});

  https://blog.csdn.net/lxw1844912514/article/details/100029390


posted @ 2020-07-24 11:54  程序生(Codey)  阅读(416)  评论(0编辑  收藏  举报