title: Disable request validation redirect in Laravel 5.4
body: <p>So I'm trying to develop a rest API for an internal project, and I've got an issue where when the form request validation fails, it shows the @index response.</p>
  
  <p>So I have two routes;</p>
  
  <pre><code>Route::get('/api/clients', 'ClientController@index');
  Route::post('/api/clients', 'ClientController@store');
  </code></pre>
  
  <p><code>@index</code> lists all clients, <code>@store</code> creates a new client and I've got a Form Request Validator on the <code>@store</code> method which checks a name is provided for the client.</p>
  
  <p>What I want is when the validator fails, it shows a JSON response with the validation errors. But what I think it happening, is the validation fails, so it redirects back to the same page, but the redirect is <code>GET</code> instead of <code>POST</code>, so it lists all the clients instead.</p>
  
  <p>I know that you can set your headers so that it looks like an ajax request, in which it will show the JSON response properly, but I want it to show the JSON response regardless of whether it's ajax or not.</p>
  
  <p>I've tried overriding the <code>response</code> method in my validator which didn't work, I've tried setting the <code>wantsJson</code> method in the validator to return true which again didn't work.</p>
  
  <p>Help would be very much appreciated.</p>
  
  <p>Code is below...</p>
  
  <p><strong>web.php</strong></p>
  
  <pre><code>Route::get('/api/clients', 'ClientController@index');
  Route::get('/api/clients/{client}', 'ClientController@show');
  Route::post('/api/clients', 'ClientController@store');
  Route::put('/api/clients/{id}', 'ClientController@update');
  Route::delete('/api/clients/{id}', 'ClientController@delete');
  </code></pre>
  
  <p><strong>ClientController.php</strong></p>
  
  <pre><code>namespace App\Http\Controllers;
  
  use App\Client;
  use App\Http\Requests\ClientRequest;
  
  class ClientController extends Controller
  {
  
      /**
       * Store a newly created resource in storage.
       *
       * @param  \Illuminate\Http\Request  $request
       * @return \Illuminate\Http\Response
       */
      public function store(ClientRequest $request)
      {
          return Client::create([
              'title'   =&gt; request('title'),
              'user_id' =&gt; auth()-&gt;id()
          ]);
      }
  </code></pre>
  
  <p><strong>ClientRequest.php</strong></p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Requests;
  
  use Illuminate\Foundation\Http\FormRequest;
  
  class ClientRequest extends FormRequest
  {
  
      /**
       * Determine if the user is authorized to make this request.
       *
       * @return bool
       */
      public function authorize()
      {
          return true;
      }
  
      /**
       * Get the validation rules that apply to the request.
       *
       * @return array
       */
      public function rules()
      {
          return [
              'title' =&gt; 'required'
          ];
      }
  
      /**
       * Get the failed validation response for the request.
       *
       * @param array $errors
       * @return JsonResponse
       */
       public function response(array $errors)
       {
           dd('exit'); // Doesn't work
       }
  }
  </code></pre>