Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.x] Fix route:list --except-vendor hiding Route::view() & Route::redirect() #41465

Merged

Conversation

derekmd
Copy link
Contributor

@derekmd derekmd commented Mar 13, 2022

Fixes #41416

php artisan route:list --except-vendor

This doesn't show paths registered via Route::view() or Route::redirect().

Don't consider Illuminate\Routing\RedirectController & Illuminate\Routing\ViewController as vendor-registered routes. Assume Route::view() or Route::redirect() were called in userland routes/*.php.


To more accurately track this, Illuminate\Routing\Route needs a new class property $isVendor. The constructor would traverse its stacktrace to find the originating call. It could be an app()->environment('development', 'testing')-only
code path but I don't think the Route class bloat is worth it considering these "magic route" methods are more a userland feature than packageland. It could also introduce a breaking change to serializing routes.

@derekmd derekmd force-pushed the route-list-illuminate-magic-routes branch from 9370c7f to 57bd20b Compare March 13, 2022 21:30
@derekmd derekmd marked this pull request as draft March 13, 2022 21:38
Don't consider Illuminate\Routing\RedirectController & ViewController
as vendor-registered routes. Assume Route::view() or Route::redirect()
were called in userland routes/*.php.
@derekmd derekmd force-pushed the route-list-illuminate-magic-routes branch from 57bd20b to 593697d Compare March 13, 2022 21:50
@derekmd derekmd marked this pull request as ready for review March 13, 2022 21:53
@taylorotwell taylorotwell merged commit bd422ae into laravel:9.x Mar 14, 2022
@derekmd derekmd deleted the route-list-illuminate-magic-routes branch March 14, 2022 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Route:view() are not listed when using --except-vendor
2 participants