Inspect Laravel routes and middleware with route:list
Run route:list with -v, -vv, and --path to inspect Laravel route names, actions, and middleware in a terminal or LaraBench Artisan mode.
Direct answer
Run php artisan route:list for the full route table. Add -v to show middleware, -vv to expand middleware groups, and --path=api to limit the output to API paths. In LaraBench, run the same arguments in Artisan mode and save the command you use during route debugging.
When to use this
Use this when a route returns 404, an endpoint has the wrong middleware, a route name is missing, or a deployment appears to be using a different route table. The commands below were checked against the Laravel 13 routing documentation.
Terminal approach
php artisan route:list
php artisan route:list -v
php artisan route:list -vv
php artisan route:list -vv --path=api
php artisan route:list --except-vendor Add a path filter when the application has hundreds of routes. Use -v for assigned middleware and -vv to see the middleware inside a group.
LaraBench approach
- Open Run Code and choose the target connection.
- Switch from Tinker to Artisan.
- Enter
route:list -vv --path=api. - Run it and inspect the method, URI, name, action, and middleware.
- Save the command if you use the same path filter during incidents.
- Check History when comparing route output across deployments.
Saved command
route:list -vv --path={path} The {path} placeholder turns this into a free single-run template. Enter api, admin, or another URI prefix when LaraBench prompts for the value.
Expected result
The output lists matching HTTP methods, URI patterns, route names, controller actions, and middleware. With -vv, middleware groups are expanded to show the concrete middleware on each route.
Troubleshooting
- If no routes match, remove
--pathand confirm the URI prefix. - If the command fails while booting, inspect the exception before treating it as a routing problem.
- If output differs from your checkout, confirm the selected connection and deployed release.
- If middleware is missing, rerun with
-vor-vvand inspect route groups inbootstrap/app.phpand the route files.
Safety notes
route:list reads the registered route table and does not change application data. The application still boots to build that table, so service-provider boot code runs. Avoid combining this diagnostic with route-cache changes until you have confirmed the deployment and cache strategy.
Related workflows
When the remote route table is the question, start with the SSH connection workflow. If route boot fails because of a binding, use the config and service container workflow.
Run these checks in LaraBench.
The free app includes Run Code, Artisan commands, Docker and SSH connections, saved items, History, logs, and benchmarks.