title: Laravel pusher error: JSON returned from webapp was invalid, yet status code was 200
body: <p>i work on laravel 5.2 and i added vinkla/laravel-pusher to do real time chat app on my site but i faced this issue:
  "JSON returned from webapp was invalid, yet status code was 200."
  this my controller:</p>
  
  <pre><code>public function authMessageChat(Request $req)
      {
  
          $channelName = e($req-&gt;input('channel_name'));
          $socketId = e($req-&gt;input('socket_id'));
          $auth = $this-&gt;pusher-&gt;presence_auth($channelName, $socketId, auth()-&gt;user()-&gt;id);
           return response($auth);
  
      }
  </code></pre>
  
  <p>this is my script:</p>
  
  <pre><code>var pusher = new Pusher('{{env("PUSHER_KEY")}}', {
      authEndpoint: '../auth',
      auth: {
          headers: {
              'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
          },
          params: {
              id: currentUser.id
          }
      }
      });
      var channel = pusher.subscribe('{{$chatChannel}}');
      channel.bind('pusher:subscription_error', function(PusherError){
              console.log('PusherError' + PusherError);
          });
          channel.bind('new-message', function(data) {
          console.log(data.sender);
  )};
  </code></pre>
  
  <p><em>Pusher error:</em>
  <img src="https://i.stack.imgur.com/MKO1c.png" alt="pusher error"></p>