title: laravel terminable middleware gets called before returning response
body: <p>I use postman to query my laravel API and the terminate method in my middleware gets called before postman receives the result:</p>
  
  <p>Route</p>
  
  <pre><code> Route::any('/lookup', 'LookupController@lookup')-&gt;name('lookup')-&gt;middleware(\App\Http\Middleware\LogRequest::class);
  </code></pre>
  
  <p>Middleware
      
  
  <pre><code>namespace App\Http\Middleware;
  
  use Closure;
  
  
  class LogRequest
  {
      public function handle($request, Closure $next)
      {
          return $next($request);
      }
  
      public function terminate($request, $response)
      {
          sleep(10);
      }
  }
  </code></pre>
  
  <p>The response arrives 10 seconds earlier when I remove the <code>sleep(10);</code> So I am sure that the server waits for terminate to finish before actually returning the response.</p>