title: How pusher send data to selected clients only
body: <p>I have used pusher recently in my PHP laravel project and it is working fine.
  What I know about pusher is that it is a real time layer between our server and client and creates web socket connection to our client browser. 
  I setup pusher in my application using below tutorial:</p>
  
  <p><a href="https://blog.pusher.com/writing-realtime-apps-with-laravel-5-and-pusher/" rel="nofollow noreferrer">pusher integration with laravel</a></p>
  
  <p>What I have created using pusher for my web application:</p>
  
  <p>1.I have created a notification functionality. Where when one user add some data to database say when one user starts following other user a event is triggered and that event sends data to particulr channel say 'notification-channel' and in my js code I have subscribed to this channel. For that I have written below line of codes:</p>
  
  <pre><code>//instantiate a Pusher object with our Credential's key
      var pusher = new Pusher('68fd8888888888ee72c', {
          encrypted: true
      });
  
      //Subscribe to the channel we specified in our Laravel Event
      var channel = pusher.subscribe('notification-channel');
  
      //Bind a function to a Event (the full Laravel class)
      channel.bind('App\\Events\\HelloPusherEvent', addMessage);
  </code></pre>
  
  <ol start="2">
  <li>By using addMessage() function I display some data. Now I have put a check on client side so that only if logged in user is intended to receive this message by writing simple if condition. As I have sent intended user's id in within data from App\Events\HelloPusherEvent so I used this Id to display msg to specific users only.</li>
  </ol>
  
  <p>But I think this is not right approach to use pusher for notifications or any other functionality. Further in my project I want to use pusher for displaying new news feeds on user's newsfeed without page refresh, where obviously few users will see those posts according to whom is posting that news post. </p>
  
  <p>But How I will user pusher in a way that I don't need to implement if conditions on client side to stop displaying data.
  Here my concern is that if I will keep sending data to all the active clients and put if conditions to filter data that will ultimately degrade my application.</p>
  
  <p><strong>My concerns:</strong></p>
  
  <ol>
  <li><p>If pusher sends data to multiple clients that is obviously all the active users then will it not cause overhead.</p></li>
  <li><p>Is there any option to use channels to channelize data to intended users only.</p></li>
  <li><p>As I am implementing pusher first time I have few doubts regarding its actual working so is there any blog which can help me to understand its real time working.</p></li>
  </ol>
  
  <p>Let me know if my question is not clear and specific enough, I will elaborate it further.</p>
  
  <p>Thanks in advance to all who will try to answer. </p>