When creating a catch-all route in Laravel, you might encounter conflicts with others routes in your application. In this post I would like to describe how you can resolve some of these conflicts. One use case for a catch-all route, is when you want to serve a single page application, for example with Vue.js, and let the JavaScript Framework handle all the routes.
This makes it easier to navigate to the controller, and will help during refactoring in most IDEs.
However, a cleaner solution would be to ignore the /admin, and /api routes in the catch-all route by adding a regular expression constraint, and make the any parameter optional: This will give you the freedom to order your route definitions logically instead of functionally.