-
-
Notifications
You must be signed in to change notification settings - Fork 248
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
Add "always" props using new Inertia::always()
wrapper
#627
Conversation
@reinink made |
Always
propsInertia::always()
wrapper
@lepikhinb Hey thanks for putting this together! 💪 |
@lepikhinb "errors" prop is empty with laravel validation after this update |
'errors' => function () use ($request) { | ||
return $this->resolveValidationErrors($request); | ||
}, | ||
'errors' => Inertia::always($this->resolveValidationErrors($request)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a breaking change, isnt it? @lepikhinb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be
After updating to v1.3.0, no errors are included in the response; it is always empty. This issue did not occur in v1.2.0. @reinink, could you please look into this? |
@datlechin @gabrielrbarbosa I couldn't reproduce the issue. Is there a chance you can make a quick reproduction? |
@lepikhinb Create a route that performs data validation. Send a request to this route with invalid data and verify that the response does not contain any error messages. |
@datlechin Please make a repo with a complete reproduction. Here's PingCRM with Inertia 1.3. |
Ah i see that what happened Previously, I used the ->withMiddleware(function (Middleware $middleware) {
$middleware->appendTo(HandleInertiaRequests::class);
}) After updating to v1.3.0, the approach needs to be changed. Now, you must use the |
@lepikhinb I found out what happened here. We had previously overridden the Response class which made this new update incompatible, I will handle this here or just fix at 1.2.0 for now, thanks anyway! |
Introduce
Inertia::always()
wrapper to replace the current persistent props implementation.Lazy data evaluation behavior: