More Readable Route List

Have you ever run "php artisan route:list" and then realized that the list takes too much space and hard to read?

Here's the solution: php artisan route:list --compact

Then it shows 3 columns instead of 6 columns: shows only Method / URI / Action.

1+----------+---------------------------------+-------------------------------------------------------------------------+
2| Method | URI | Action |
3+----------+---------------------------------+-------------------------------------------------------------------------+
4| GET|HEAD | / | Closure |
5| GET|HEAD | api/user | Closure |
6| POST | confirm-password | App\Http\Controllers\Auth\ConfirmablePasswordController@store |
7| GET|HEAD | confirm-password | App\Http\Controllers\Auth\ConfirmablePasswordController@show |
8| GET|HEAD | dashboard | Closure |
9| POST | email/verification-notification | App\Http\Controllers\Auth\EmailVerificationNotificationController@store |
10| POST | forgot-password | App\Http\Controllers\Auth\PasswordResetLinkController@store |
11| GET|HEAD | forgot-password | App\Http\Controllers\Auth\PasswordResetLinkController@create |
12| POST | login | App\Http\Controllers\Auth\AuthenticatedSessionController@store |
13| GET|HEAD | login | App\Http\Controllers\Auth\AuthenticatedSessionController@create |
14| POST | logout | App\Http\Controllers\Auth\AuthenticatedSessionController@destroy |
15| POST | register | App\Http\Controllers\Auth\RegisteredUserController@store |
16| GET|HEAD | register | App\Http\Controllers\Auth\RegisteredUserController@create |
17| POST | reset-password | App\Http\Controllers\Auth\NewPasswordController@store |
18| GET|HEAD | reset-password/{token} | App\Http\Controllers\Auth\NewPasswordController@create |
19| GET|HEAD | verify-email | App\Http\Controllers\Auth\EmailVerificationPromptController@__invoke |
20| GET|HEAD | verify-email/{id}/{hash} | App\Http\Controllers\Auth\VerifyEmailController@__invoke |
21+----------+---------------------------------+-------------------------------------------------------------------------+

You can also specify the exact columns you want:

php artisan route:list --columns=Method,URI,Name

1+----------+---------------------------------+---------------------+
2| Method | URI | Name |
3+----------+---------------------------------+---------------------+
4| GET|HEAD | / | |
5| GET|HEAD | api/user | |
6| POST | confirm-password | |
7| GET|HEAD | confirm-password | password.confirm |
8| GET|HEAD | dashboard | dashboard |
9| POST | email/verification-notification | verification.send |
10| POST | forgot-password | password.email |
11| GET|HEAD | forgot-password | password.request |
12| POST | login | |
13| GET|HEAD | login | login |
14| POST | logout | logout |
15| POST | register | |
16| GET|HEAD | register | register |
17| POST | reset-password | password.update |
18| GET|HEAD | reset-password/{token} | password.reset |
19| GET|HEAD | verify-email | verification.notice |
20| GET|HEAD | verify-email/{id}/{hash} | verification.verify |
21+----------+---------------------------------+---------------------+

Like our articles?

Become a Premium Member for $129/year or $29/month
What else you will get:
  • 22 courses (477 lessons, total 38 h 20 min)
  • 2 long-form tutorials (one new every week)
  • access to project repositories
  • access to private Discord