I have a form and I can send data through and get data in controller and see it but when use validation as below:
$validation= $request->validate([
'title' => 'required|unique:posts|max:255',
'body' => 'required',
'message' => 'required'
]);
I have status 302 I don't know what to do
Http Status Code 302 means that the API (server) requests a redirect. That is the expected behavior of Laravel validation if the validation do not pass. If you want Laravel to return json instead, add the following key value pair to your request headers.
accept: application/json
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With