Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel api form request validation 404

Set an "Accept": "application/json" Request Header
 -- OR --
force the default response behavior by sepcifying the response() method
in your own CustomFormRequest class:
// -- example -- //
public function response(array $errors)
{
    // Always return JSON.
    return response()->json($errors, 422);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #api #form #request #validation
ADD COMMENT
Topic
Name
9+6 =