order of route declarations in laravel package

2019-01-28 07:48发布

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?

1条回答
我欲成王,谁敢阻挡
2楼-- · 2019-01-28 08:34

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.

update

I believe you could just register the route in the App::before filter, which would register it after all user routes.

查看更多
登录 后发表回答