title: Why does Laravel redirect to a wrong id after DB::listen?
body: <p>I would like to store every query I run inside my application. To do that, I've created a "loggers" table, a Logger modal and this function inside my boot AppServiceProvider</p>
  
  <pre><code>DB::listen(function($query) {
      $logger = new Logger;
      $logger-&gt;query = str_replace('"', '', $query-&gt;sql);
      $logger-&gt;bindings = json_encode($query-&gt;bindings);
      $logger-&gt;created_at = Carbon::now();
      $logger-&gt;save();
  });
  </code></pre>
  
  <p>Well, anytime I run an insert query, Laravel returns the loggers table ID instead of the model last inserted ID.
  Why on earth does this happen?</p>
  
  <pre><code>public function store(CycleRequest $request) {
      $appointment = new Appointment;
      $appointment-&gt; ... same data ...
      $appointment-&gt;save();
  
      if ( ! $errors ) ){
          $msg['redirect'] = route('appointments.edit', $appointment);
  
          // The page redirects to last logger id
      }
  }
  </code></pre>