-
-
Notifications
You must be signed in to change notification settings - Fork 540
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
[5.x] Support Laravel precognition on user forms #8924
[5.x] Support Laravel precognition on user forms #8924
Conversation
@jasonvarga I've updated this now the main PR has merged. It should follow the same principles. |
The login form is expecting the "default" error bag but we're providing one here so when you submit, no errors will be shown. Ideally we should change the tag to expect an error bag named user.login but that might be considered a breaking change.
… fields though as they aren't normally in the blueprint.
Just putting these here for the docs. When following our own forms docs for how to set up precognition, it explains we have to add an inner div with the precognition $form. Since the user tags don't have the whole js driver x-data thing, we can't grab the data off the Instead, we can grab the values from {{? $values = collect($fields)->mapWithKeys(fn ($field) => [
$field['handle'] => $field['value']
]) ?}}
<div x-data='{
form: $form(
"post",
$refs.form.getAttribute("action"),
{{$ $values->toJson() $}}
).setErrors({{ error | json }}),
}'> |
Thank you ❤️ |
It seems custom error bags names for user login form hasn't been integrated, wiil it be done ? |
Feel free to submit a PR if you need it yourself, or open a feature request. |
This PR adds support for Laravel Precognition to user forms (login, register, profile and password).
Again I've moved the validation logic out of the UserController and into separate FormRequests.
Closes #6950
Closes #7890