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] Replace model:show searched value with correct FQCN #45160

Merged
merged 3 commits into from
Dec 1, 2022

Conversation

bloomlive
Copy link
Contributor

Problem
Currently, while using php artisan model:show the result features the name of the class in the exact way you wrote it.

In PHP, class names as well as function/method names are case-insensitive, but it is considered good practice to them functions as they appear in their declaration. Therefore it makes sense to return the name of the class as intended, however, while drawing the developers attention to it.

Proof of concept
php artisan model:show RUle results in the following:
Screenshot 2022-12-01 at 17 59 55

Explanation of work
This PR checks if the provided model name matches what would be returned and appends searched value while replacing the original with correct casing.

Result
Incorrect casing results in:
Screenshot 2022-12-01 at 17 58 52
Initially correct casing results in:
Screenshot 2022-12-01 at 18 00 38

@taylorotwell taylorotwell merged commit 1dc5970 into laravel:9.x Dec 1, 2022
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.

2 participants