12345678910111213141516171819202122 |
- <?php
- namespace App\Http\Requests;
- use Dingo\Api\Http\FormRequest as BaseFormRequest;
- use Illuminate\Http\Exceptions\HttpResponseException;
- class FormRequest extends BaseFormRequest
- {
- public function authorize()
- {
- return true;
- }
- public function failedValidation($validator)
- {
- $error= $validator->errors()->all();
- throw new HttpResponseException(response()->json(['code'=>202,'message'=>$error[0]]));
- }
- }
|