Add regex filtering option to route:list command #55449
Unanswered
mohammadrasoulasghari
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In large Laravel applications with many routes across different modules, finding specific routes can be challenging. The current filtering options (--path, --name, etc.) work well for simple cases but lack flexibility for complex filtering needs.
I’d like to propose adding a new --regex option to the route:list command to improve route filtering capabilities.
Add a new --regex option that accepts regular expressions to filter routes with maximum flexibility:
php artisan route:list --filter="pattern"
This would allow developers to create precise filters that match their specific needs, making route management much easier in large applications. 🔍
Find all API routes with version numbers
php artisan route:list --regex="^api\/v[0-9]+"
This would match routes like /api/v1/users, /api/v2/products, etc.
Find all routes that aren't API or admin routes
php artisan route:list --regex="^(?!(api|admin))"
This would exclude routes starting with /api/ or /admin/
This option can be called filter or regex, whichever is better and more transparent.
I believe this feature would enhance the developer experience when working with complex route structures. What do you think? 🚀
Beta Was this translation helpful? Give feedback.
All reactions