title: Laravel Ajax POST Request does not work: 302 found
body: <p>I'm trying to push some data via ajax in Laravel. Unfortunally it does not work. When I was watching at the network traffic, i found this:</p>
  
  <pre><code>Request Method:POST
  Status Code:302 Found
  </code></pre>
  
  <p>I'm trying to get data from a JSGrid, which works fine. The data-object is filled. I checked it. For testing I just returned a short message in my controller. But it's not even called when I send the POST request...</p>
  
  <p>Here is my code</p>
  
  <p>Javascript:</p>
  
  <pre><code>$.ajaxSetup({
      headers: {'X-CSRF-Token': $('meta[name=token]').attr('content')}
  });
  $('#save_list').click(function (e) {
      e.preventDefault();
      var url = '{{ route("account.save_accounts_to_user") }}';
      var post = {};
      post.account_list = $("#jsGrid").jsGrid("option", "data");
  
      $.ajax({
          type: "POST",
          url: url,
          dataType: 'JSON',
          data: post,
          cache: false,
          success: function (data, textStatus, jqXHR) {
              console.log(textStatus + " - " + data);
              return data;
          },
          error: function (jqXHR, textStatus, errorThrown) {
              console.log(jqXHR.responseText + textStatus + " - " + errorThrown);
          }
      });
      return false;
  });
  </code></pre>
  
  <p>Route:</p>
  
  <pre><code>Route::post('save_accounts_to_user', ['as' =&gt; 'account.save_accounts_to_user', 'uses' =&gt; 'AccountController@saveAccountsToUser']);  //ajax request   
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>/**
   * Save all used accounts for a user.
   *
   * @param  \Illuminate\Http\Request $request
   * @return \Illuminate\Http\Response
   */
  public function saveAccountsToUser(Request $request)
  {
      $response = array();
      $response["status"] = "ok";
      $response["message"] = trans('account.accounts_saved');
  
      return \Response::json($response);
  }
  </code></pre>
  
  <p>I was expecting that I will get the JSON text from the controller method as the responsemessage. But instead i get redirected without calling the wanted method.
  I don't know what happens there. There is no middleware assigned to this route, which could be the reason for this redirect. </p>
  
  <p>Do you have an ideas?</p>