laravel 万能路由( 自动路由、动态路由)实现方法分享

Lenix at 
laravel 万能路由 自动路由 动态路由有了万能路由就不用一条一条添加路由了,很方便。如果你要用资源控制器做 Restful 接口,那还是要写资源路由的,注意,资源路由一定要写在最上面。Route::resource('photos', 'PhotoController');//资源路由要写在上面。 //万能路由 Route::group(['middleware'=>['web']],function (){ Route::any("/{module}/{controller}/{action}",function ($module,$class,$action){ ……