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] Check route:list --columns option case insensitively #32521

Merged
merged 1 commit into from
Apr 24, 2020
Merged

[7.x] Check route:list --columns option case insensitively #32521

merged 1 commit into from
Apr 24, 2020

Conversation

matt-allan
Copy link
Contributor

The route:list command has a --columns option you can use to specify what columns should be used. Weirdly if you use the same case for the column names the output uses nothing at all gets printed:

 $ php artisan route:list --columns 'Method,Uri'

It only works if you use all lowercase:

$ php artisan route:list --columns 'method,uri'
+----------+------------------------+
| Method   | URI                    |
+----------+------------------------+
| GET|HEAD | /                      |
| GET|HEAD | api/user               |
| GET|HEAD | home                   |
| GET|HEAD | login                  |
| POST     | login                  |
| POST     | logout                 |
| GET|HEAD | password/confirm       |
| POST     | password/confirm       |
| POST     | password/email         |
| GET|HEAD | password/reset         |
| POST     | password/reset         |
| GET|HEAD | password/reset/{token} |
| GET|HEAD | register               |
| POST     | register               |

This PR changes the comparison to be case-insensitive so you can use the same case as the output, lowercase, all uppercase, etc and it still works:

 $ php artisan route:list --columns 'Method,URI,name'  
+----------+------------------------+------------------+
| Method   | URI                    | Name             |
+----------+------------------------+------------------+
| GET|HEAD | /                      |                  |
| GET|HEAD | api/user               |                  |
| GET|HEAD | home                   | home             |
| GET|HEAD | login                  | login            |
| POST     | login                  |                  |
| POST     | logout                 | logout           |
| GET|HEAD | password/confirm       | password.confirm |
| POST     | password/confirm       |                  |
| POST     | password/email         | password.email   |
| GET|HEAD | password/reset         | password.request |
| POST     | password/reset         | password.update  |
| GET|HEAD | password/reset/{token} | password.reset   |
| GET|HEAD | register               | register         |
| POST     | register               |                  |
+----------+------------------------+------------------+

@taylorotwell taylorotwell merged commit 0cb79e1 into laravel:7.x Apr 24, 2020
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