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

[7.x] Use new line for route:list middleware #32993

Merged
merged 1 commit into from
May 28, 2020
Merged

[7.x] Use new line for route:list middleware #32993

merged 1 commit into from
May 28, 2020

Conversation

ellisio
Copy link
Contributor

@ellisio ellisio commented May 27, 2020

I think this change modified how route middleware is displayed. Routes groups are now displayed using all middleware class names, instead of say web. Because of this, the Middleware column is massive for routes that use web.

I recommend changing the join to new lines, so middleware is listed just like event listeners.

The below examples were generated using php artisan route:list --path telescope/telescope-api/jobs.

Examples with ,:

+--------+----------+-------------------------------------------------+------+----------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| Domain | Method   | URI                                             | Name | Action                                                   | Middleware                                                                                                                              |
+--------+----------+-------------------------------------------------+------+----------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
|        | POST     | telescope/telescope-api/jobs                    |      | Laravel\Telescope\Http\Controllers\QueueController@index | App\Http\Middleware\JsonMiddleware,Illuminate\Routing\Middleware\ThrottleRequests:60,1,Illuminate\Routing\Middleware\SubstituteBindings |
|        | GET|HEAD | telescope/telescope-api/jobs/{telescopeEntryId} |      | Laravel\Telescope\Http\Controllers\QueueController@show  | App\Http\Middleware\JsonMiddleware,Illuminate\Routing\Middleware\ThrottleRequests:60,1,Illuminate\Routing\Middleware\SubstituteBindings |
+--------+----------+-------------------------------------------------+------+----------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+

Example with new line:

+--------+----------+-------------------------------------------------+------+----------------------------------------------------------+-----------------------------------------------------+
| Domain | Method   | URI                                             | Name | Action                                                   | Middleware                                          |
+--------+----------+-------------------------------------------------+------+----------------------------------------------------------+-----------------------------------------------------+
|        | POST     | telescope/telescope-api/jobs                    |      | Laravel\Telescope\Http\Controllers\QueueController@index | App\Http\Middleware\JsonMiddleware                  |
|        |          |                                                 |      |                                                          | Illuminate\Routing\Middleware\ThrottleRequests:60,1 |
|        |          |                                                 |      |                                                          | Illuminate\Routing\Middleware\SubstituteBindings    |
|        | GET|HEAD | telescope/telescope-api/jobs/{telescopeEntryId} |      | Laravel\Telescope\Http\Controllers\QueueController@show  | App\Http\Middleware\JsonMiddleware                  |
|        |          |                                                 |      |                                                          | Illuminate\Routing\Middleware\ThrottleRequests:60,1 |
|        |          |                                                 |      |                                                          | Illuminate\Routing\Middleware\SubstituteBindings    |
+--------+----------+-------------------------------------------------+------+----------------------------------------------------------+-----------------------------------------------------+

With [this change](7ebd211), routes groups are now displayed using all middleware class names, instead of say `web`. Because of this, the Middleware column is massive for routes that use `web`.

I recommend changing the join to new lines, so middleware is listed just like event listeners.
@gargashwani
Copy link

Here is the fix, if you are still facing issues in Laravel 8 with Sanctum.

7ebd211

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.

3 participants