title: Laravel event not being Broadcast
body: <p>I am working on a chat/message feature for an app. When a User sends a message, I want a specific Event to be triggered and to be broadcasted. I am then wanting Laravel Echo to listen on the event's broadcast channel to an event via Laravel Echo, using the <code>pusher</code> driver.</p>
  
  <p>I am wanting the Laravel Echo implementation to be in a Vue component and to retrieve the data that was broadcasted via the event. Currently, I can't get an event to broadcast to either a private channel or just a channel.</p>
  
  <p>Here is what I have done:</p>
  
  <p>1) Added the config to <code>.env</code>.</p>
  
  <p>2) Added config to <code>bootstrap.js</code> :</p>
  
  <pre><code>window.Echo = new Echo({
    broadcaster: 'pusher',
    key: 'mykey',
    encypted: false
  });
  </code></pre>
  
  <p>3) Added auth check in <code>App\Providers\BroadcastServiceProvider</code> (just returning true if User is signed in for now):</p>
  
  <pre><code>Broadcast::channel('chat', function ($user) {
    // verify that user is recipient of message
    return \Auth::check();
  });
  </code></pre>
  
  <p>4) Added <code>App\Providers\BroadcastServiceProvider::class,</code> to <code>App/config/app.php</code>.</p>
  
  <p>5) Created the Event <code>App\Events\UserSentMessage</code>, which broadcasts on a <code>PrivateChannel</code> named <code>chat</code>. I have also tried to broadcast to a <code>Channel</code>. I checked and the event is being fired from a call to the <code>event()</code> helper in a controller, it just seems to not be broadcast. I have also tried using the <code>broadcast</code> method in the controller mentioned.</p>
  
  <p>6) Added the following within the <code>mounted</code> Vue life cycle hook in a valid Vue component (component is rendering data etc as expected, just not working with Laravel Echo atm): </p>
  
  <pre><code>    Echo.private('chat').listen('UserSentMessage', (data) =&gt; {
                  console.log(data);
              }, (e) =&gt; {
                  console.log(e);
              });
  </code></pre>
  
  <p>Have also tried:</p>
  
  <pre><code>     Echo.channel('chat').listen('UserSentMessage', (data) =&gt; {
                  console.log(data);
              }, (e) =&gt; {
                  console.log(e);
              });
  </code></pre>
  
  <p>The Vue component is successfully subscribing to the channel specified. The pusher debug console recognized that it is being subscribed to, but the Event, when triggered never gets broadcasted.</p>
  
  <p>Seems to be that there is a problem with broadcasting the event. I have also tried using the <code>broadcast()</code> helper, rather than the <code>event()</code> helper. </p>
  
  <p>Also, when subscribing to the event with Laravel Echo via <code>Echo.private()</code>. It seems to prefix the channel name with <code>private</code>, so I have also tried broadcasting (in the event) to a channel named <code>private-chat</code>.</p>