[9.x] Added --only-vendor option to route:list command #42549
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey! This PR is only a small one but I think it could be useful. It adds a new
--only-vendor
option that you can use when calling theroute:list
command. If you use this option, only the vendor routes will be output in the terminal (your own application's routes will be ignored).This is example of what it would look like:
I think this is something that could be pretty handy because it gives you a quick insight into any routes that you aren't aware of that might have been registered by packages.
I know in the past that I've installed packages in my projects and only realised further down the line that they're registering routes (usually for a feature that I'm not needing). So, by having this, it'd make it easier to "audit" (for lack of a better term) my project and make sure I've not got any open routes that are expecting authorisation or authentication to be added to them (via a service provider, config, etc).
By the way, I did consider adding some validation to check that the
--only-vendor
and--except-vendor
flags weren't passed at the same time. But, it looks like if you do that anyway, you'll get the following error message:Your application doesn't have any routes matching the given criteria.
which sort of covers the base already. If you think a specific error message would be better for this situation, I'd be happy to add it.If this is something that you might consider merging, please let me know if any changes need making 😄