问题描述
我制作了一个包含路由的 laravel 包,它是一个特殊的路由,可以捕获大量可能的 url.我不希望我的路由优先于主应用程序中声明的其他包或路由.如何确保我的路线是最后声明的路线?
I have made a laravel package which contains a route, it is a special route that catches a large number of possible urls. I don't want my route to take precedence over other packages or routes declared in the main application. How can I ensure that my route is the last route declared?
推荐答案
路由按照它们在 routes.php 中列出的顺序进行评估.只需确保这条路线是数组中的最后一条即可.
Routes are evaluated in the order that they are listed in routes.php. Simply making sure this route is the last one in the array should do it.
更新
我相信你可以在 App::before 过滤器中注册路由,它会在所有用户路由之后注册它.
I believe you could just register the route in the App::before filter, which would register it after all user routes.
这篇关于laravel 包中路由声明的顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!



大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)