This JSON response will be sent with a 422 HTTP status code. Instead, Laravel generates a JSON response containing all of the validation errors. When using the validate method during an AJAX request, Laravel will not generate a redirect response. ![]() This is documented for the ValidatesRequest trait (using the validate method): At least, this is what was happening in my case. Without the Accept: application/json header, I believe Laravel is calling redirect()->back() and sending the user to an invalid route, hence the 404. Okay, I think I've figured out some more information.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |