Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class APIRequest extends FormRequest
- {
- public function response(array $errors)
- {
- if ($this->ajax() || $this->wantsJson())
- {
- return new JsonResponse($errors, $this->responseCode());
- }
- }
- protected function responseCode()
- {
- return 422;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement