Skip to content

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

Merged
taylorotwell merged 1 commit intolaravel:7.xfrom
ellisio:patch-1
May 28, 2020
Merged

[7.x] Use new line for route:list middleware#32993
taylorotwell merged 1 commit intolaravel:7.xfrom
ellisio:patch-1

Conversation

@ellisio
Copy link
Copy Markdown
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
Copy Markdown

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