Advertisement
Guest User

Untitled

a guest
May 25th, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. <?php
  2.  
  3. class APIRequest extends FormRequest
  4. {
  5. public function response(array $errors)
  6. {
  7. if ($this->ajax() || $this->wantsJson())
  8. {
  9. return new JsonResponse($errors, $this->responseCode());
  10. }
  11. }
  12.  
  13. protected function responseCode()
  14. {
  15. return 422;
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement