title: Undefined eager-loaded relationship when using Echo event broadcasting
body: <p>I am using Laravel Echo in my project to broadcast events to the client-side. Everything is working correctly, however, I am having a problem in <code>eager-loading</code> the relationships of the model for the Event.</p>
  <p>My Controller</p>
  <pre><code>$chat = new Chat;
  $chat-&gt;user_id = $request-&gt;user_id;
  $chat-&gt;message = $request-&gt;message;
  $chat-&gt;save();
  
  event( new GetMessages( $chat ));
  </code></pre>
  <p>My Event class:</p>
  <pre><code>class GetMessages implements ShouldBroadcast
  
  {
      use Dispatchable, InteractsWithSockets, SerializesModels;
  
      public $chats;
      public function __construct($chats)
      {
          $this-&gt;chats = $chats;
      }
  
      public function broadcastOn()
      {
          return ['get-messages'];
      }
  
      public function broadcastAs()
      {
          return 'get-messages';
      }
  }
  </code></pre>
  <p>Here is my Laravel Echo</p>
  <pre><code>Echo.channel('get-messages')
      .listen('.get-messages', (data) =&gt; {
          console.log(data)
      })
  </code></pre>
  <p>Everything is working fine as I expected, except getting the <code>attachments </code> from the <code>Chat</code>.</p>
  <pre><code>console.log(data.chats); // Undefined
  </code></pre>
  <p>Is there something I missed? Because as I tested the <code>eager-loaded</code> from the Event class itself, I can access the <code>attachments</code> in there.</p>
  <pre><code>public $chats;
  public function __construct($chats)
  {
      $this-&gt;chats = $chats;
      echo $chats-&gt;attachments // It's working in here, I can get the attachments
  }
  </code></pre>
  <p>Hope I explain it well, Thank you in advance</p>
  <p>Cheers!</p>
  <p>Here is the <code>console.log</code></p>
  <p><a href="https://i.stack.imgur.com/j8PYz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j8PYz.png" alt="enter image description here" /></a></p>
  <p>Here is <code>use</code>, it's the default when I created the Event</p>
  <pre><code>namespace App\Events;
  
  use Illuminate\Broadcasting\Channel;
  use Illuminate\Queue\SerializesModels;
  use Illuminate\Broadcasting\PrivateChannel;
  use Illuminate\Broadcasting\PresenceChannel;
  use Illuminate\Foundation\Events\Dispatchable;
  use Illuminate\Broadcasting\InteractsWithSockets;
  use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
  
  class GetMessages implements ShouldBroadcast
  {
      use Dispatchable, InteractsWithSockets, SerializesModels;
  ...
  </code></pre>