Closed YakutD closed 1 month ago
Inertia would already convert those redirect responses to a 303 response (https://inertiajs.com/redirects#303-response-code), which would instruct the browser to perform the follow-up request using GET.
Inertia would already convert those redirect responses to a 303 response (https://inertiajs.com/redirects#303-response-code), which would instruct the browser to perform the follow-up request using GET.
What version of the adapter made this possible?
That behaviour has been in the Laravel adapter since the first released version; https://github.com/inertiajs/inertia-laravel/blob/v0.1.0/src/Middleware.php#L28
That behaviour has been in the Laravel adapter since the first released version; https://github.com/inertiajs/inertia-laravel/blob/v0.1.0/src/Middleware.php#L28
When I encountered this problem I was working on a project with the adapter "inertiajs/inertia-laravel": "^0.6.8". And I have to use _method in the form.
When I encountered this problem I was working on a project with the adapter "inertiajs/inertia-laravel": "^0.6.8". And I have to use _method in the form.
Then the issue probably lies somewhere else, as Inertia would already take care of it when the middleware is applied
When I encountered this problem I was working on a project with the adapter "inertiajs/inertia-laravel": "^0.6.8". And I have to use _method in the form.
Then the issue probably lies somewhere else, as Inertia would already take care of it when the middleware is applied
Are you sure that the request even gets into this middleware if the redirect is initiated by the exception handler?
I'm closing this PR since there's no issue with Inertia.js. @YakutD use Discussions if you still need help debugging this problem on your project.
When submitting a form using methods other than GET and POST, browser redirect errors may occur. For example, if you have a secure DELETE route and you are logged out, the browser will redirect you to the authentication page via DELETE method. Having _method in data solves this problem. Also, I leave the option to override this property in the transform method.