-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Camelcase properties don't get shortened in validation messages properly #2079
Comments
If your provided solution does indeed work, would you mind opening a PR and add the necessary tests? |
@JoshMoreno thanks for the suggestion on the fix -- added a PR for it #2229 with a test. |
fixed property name shortening when camelcased - closes #2079
👋 Oh Hi! I'm Squishy, the friendly jellyfish that manages Livewire issues. I see this issue has been closed. Here in the Livewire repo, we have an "issues can be closed guilt-free and without explanation" policy. If for ANY reason you think this issue hasn't been resolved, PLEASE feel empowered to re-open it. Re-opening actually helps us track which issues are a priority. Reply "REOPEN" to this comment and we'll happily re-open it for you! (More info on this philosophy here: https://twitter.com/calebporzio/status/1321864801295978497) |
Description
The attribute name is not shortened when using model property binding if the property name is camelcase.
In the example below naming the property
$companyProfile
results in this bug. Snake case and all lower case work as expected:Exact steps to reproduce
CompanyProfile
model with a string name column.It should read:
Stripped-down, copy-pastable code snippets
app/Http/Livewire/UpdateCompanyProfileForm.php
resources/views/livewire/update-company-profile-form.blade.php
Fix
https://github.com/livewire/livewire/blob/master/src/ComponentConcerns/ValidatesInput.php#L212
Context
The text was updated successfully, but these errors were encountered: