123456789101112131415161718192021222324 |
- <?php
- namespace App\Http\Requests;
- use Illuminate\Foundation\Http\FormRequest;
- use Symfony\Component\HttpKernel\Exception\HttpException;
- use Illuminate\Contracts\Validation;
- class BaseRequest extends FormRequest
- {
- public function authorize()
- {
- return true;
- }
- /**
- * Get the validation rules that apply to the request.
- * @param Validation\Validator $validator
- */
- protected function failedValidation(Validation\Validator $validator)
- {
- throw new HttpException(403, $validator->errors()->first());
- }
- }
|