title: Laravel : Broadcast event with PresenceChannel
body: <p>I'm trying to broadcast an event in a case where two user share a conversation (like a chat) where only the two of the can access and get notified when a new message comes.</p>
  
  <p>I think, after reading the documentation that the presence channel is the best option (private is for one people and the server and channel is for something plublic without checking ?)</p>
  
  <p>So in my <code>routes/channels.php</code> I have something like this:</p>
  
  <pre><code>Broadcast::channel('conversation.{conversation}', function ($user, Conversation $conversation) {
      if ($user-&gt;id === $conversation-&gt;user1_id || $user-&gt;id === $conversation-&gt;user2_id) {
          return $user;
      }
  
      return null;
  });
  </code></pre>
  
  <p>In the client side a Component I have:</p>
  
  <pre><code>Echo
  .join('conversation.${conversation.id}')
  .here((users) =&gt; {
      this.usersInRoom = users;
  })
  .joining((user) =&gt; {
      this.usersInRoom.push(user);
  })
  .leaving((user) =&gt; {
      this.usersInRoom = this.usersInRoom.filter(u =&gt; u != user);
  })
  .listen('MessagePosted', (e) =&gt; {
      this.messages.push({
          id :e.message.id,
          user_id :e.message.user_id,
          conversation_id :e.message.conversation_id,
          user :e.user,
          text :e.message.text,
          created_at :e.message.created_at,
          updated_at :e.message.updated_at,
      });
  });
  </code></pre>
  
  <p>And the class that emit the even MessagePosted :</p>
  
  <pre><code>public function broadcastOn()
  {
      return new PresenceChannel('conversation.'.$this-&gt;message-&gt;conversation_id);
  }
  </code></pre>
  
  <p>So I now that previously I used a PresenceChannel without any checking, so if two people where in there conversation they would get notification from everyone. not the right thing.</p>
  
  <p>In the server side, I have the <code>'conversation.{conversation}'</code> that was mentioned in the documentation to make a separated channel. But I also saw something like <code>'conversation.*'</code>.</p>
  
  <p>And on the client side I have <code>join('conversation.${conversation.id}')</code> but here I am not sure at all I just know that I have in the props (props : ['user', 'friend', 'conversation']) a conversation which is an object with the id of the conversation.</p>
  
  <p>So When, when everyone was on the same channel with no restriction everything was working perfectly and now, I think I have an error which make the whole thing not work. </p>
  
  <p>I have two 500 server side error when I load a client conversation :</p>
  
  <pre><code>ReflectionException in Broadcaster.php line 170:
  Class Conversation does not exist
  </code></pre>
  
  <p>(And in the route/channels.php I import the Conversation class <code>use App\Conversation;</code>)</p>
  
  <p>and </p>
  
  <pre><code>HttpException in Broadcaster.php line 154:
  </code></pre>