title: Why does Laravel middleware get executed multiple times?
body: <p>I am trying to add a very simple visitor logging to my Laravel site, just by adding a new middleware, with a log line, but I am getting two log entries on each request?</p>
  
  <p>The middleware is very straight forward:</p>
  
  <pre class="lang-php prettyprint-override"><code>class LogVisitor
  {
      public function handle($request, Closure $next)
      {
          Log::channel('access')-&gt;info($request-&gt;ip() .';' . $request-&gt;url());
  
          return $next($request);
      }
  }
  </code></pre>
  
  <p>I have even tried to move the logging line to the terminate method:</p>
  
  <pre class="lang-php prettyprint-override"><code>class LogVisitor
  {
      public function handle($request, Closure $next)
      {
          return $next($request);
      }
  
      public function terminate(Request $request, $response)
      {
          Log::channel('access')-&gt;info($request-&gt;ip() .';' . $request-&gt;url());
      }
  }
  </code></pre>
  
  <p>but it makes no different...
  I have even tried to add a variable to the $request variable, and check if it is set, but it looks like the $request variable is also reset on each execution.</p>
  
  <p>It looks like the whole thing is being executed twice, but if I try to make a var_dump inside, it only shows once..</p>
  
  <p>I was expecting it to run only once?
  Does anyone have a good idea how to make sure it only moakes one entry pr request?</p>