title: In Laravel, Middleware is ignored in ajax request?
body: <p>This is the method in controller. It is requested by x-editable ajax.</p>
  
  <pre><code>/**
   * Update base info such as status.
   *
   * @param Request $request
   * @return mixed
   */
  public function postUpdateInfo(Request $request)
  {
      $this-&gt;middleware('recruit');
      dd('passed');
      $recruit = Recruit::find($request-&gt;get('pk'));
      list($key, $value) = array($request-&gt;get('name'), $request-&gt;get('value'));
      if ($recruit-&gt;update([$key =&gt; $value])) {
          return Response::json(['success' =&gt; 1]);
      }
  }
  </code></pre>
  
  <p>In middleware, codes below:</p>
  
  <pre><code>/**
   * Handle an incoming request.
   *
   * @param  \Illuminate\Http\Request $request
   * @param  \Closure $next
   * @return mixed
   */
  public function handle($request, Closure $next, $permission)
  {
      die();
      if (Entrust::can($permission)) {
          return $next($request);
      }
  
      $this-&gt;belongsToMe($request, $this-&gt;instance);
  
      return $next($request);
  }
  </code></pre>
  
  <p>But in chrome, I view the response in network.</p>
  
  <p><a href="https://i.stack.imgur.com/NOjJi.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NOjJi.jpg" alt="enter image description here"></a></p>
  
  <p>So, I think middleware is ignored in ajax request? So amazing.</p>
  
  <p>Thanks a lot.</p>