Laravel route.php越来越大
问题描述:
随着您不断向Routes.php添加越来越多的路由,它会变得越来越大.您如何组织它们?
As you continually add more and more routes to Routes.php it gets bigger and bigger. How do you organize them?
答
我通常使用分组路由(因为与控制器相关的控制器往往具有相同类型的过滤器)来组织它们,或者如果您希望/可以拥有较小的路由文件,则可能要
I usually use Group routes (because controllers tend to have the same type of filtering needed if they are related) to organize them or if you wish to/can have a smaller routes file you might want to register your controllers and do the extra validation checks of the URL's parameters inside the controller itself.