Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel form request validation api

use IlluminateHttpResponse;

protected function failedValidation(IlluminateContractsValidationValidator $validator)
{
    $response = new Response(['error' => $validator->errors()->first()], 422);
    throw new ValidationException($validator, $response);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #form #request #validation #api
ADD COMMENT
Topic
Name
8+5 =