title: Laravel 5.5 - SerializesModels on event causes ModelIdentifier error?
body: <p>I have a laravel event with a few listeners. Some listeners or their notifications (depending if they are time consuming) are implementing the <code>ShouldQueue</code> so they run in the background on a <code>redis</code> queue. The event uses <code>SerializesModels</code> by default, but when one of the passed models to the event is the logged in user and we fire it, like this:</p>
  
  <pre><code>$user = $this-&gt;user(); // logged in user instance
  event(new UserCreatedPost($user, $post, $modelX, $modelY));
  </code></pre>
  
  <p>I am not able to access the user's followers in the respective listener, to check whether or not to notify them if they exist:</p>
  
  <pre><code>// In listener handle method
  public function handle(UserCreatedPost $event){
      $followers = $event-&gt;user-&gt;followers()-&gt;get();
  }
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>Call to undefined method Illuminate\Contracts\Database\ModelIdentifier::followers()
  </code></pre>
  
  <p>The only way I was able to get it to work was to add event wakeup below:</p>
  
  <pre><code>public function handle(UserCreatedPost $event){
      // This fixes it, as it unserializes all the models
      // (even though we only need this model to be unserialized, not all of them)
      $event-&gt;__wakeup();
  
  
      $followers = $event-&gt;user-&gt;followers()-&gt;first();
      // If at least one follower exists send queued notification
      // else exit
  }
  </code></pre>
  
  <p>I <strong>do</strong> use the <code>$user</code> instance in a few other listeners under the same event and other event listeners. I don't even know if the <code>$user</code> should be serialized in the first place at all, but it is a model, so the parent event <code>SerializesModels</code> trait automatically serializes all the models (and I don't know of any way to make this specific model not be serialized while other models yes).</p>
  
  <p>Is there a better way to be able to access the <code>$user</code> in the listeners without having to do the <code>wakeup</code> call at all? I have many events with listeners, and just got to implementing queues now, so I really don't want to add that <code>wakeup</code> to all areas in all files that the error would appear, but I do want to queue some of the listeners or their notifications. An alternative would be to  <strong>remove</strong> the event <code>SerializesModels</code> trait and not even worry about that error showing up under this or any other listener I have yet to discover this error in. Are there any issues that can arise, like performance for example or others, by implementing the alternative approach? Any better way?</p>