title: Pusher authentication not working as expected
body: <p>I have made a project with Laravel and react. There is a react component defined for video chat. Video is working but I am having issues with presence_auth(), basically getting the error with response 500 ()</p>
  
  <pre><code>Call to undefined method Pusher\Pusher::presence_auth()
  </code></pre>
  
  <p>Following is my web routes file:</p>
  
  <pre><code>&lt;?php
  
  /*
  |--------------------------------------------------------------------------
  | Web Routes
  |--------------------------------------------------------------------------
  |
  | Here is where you can register web routes for your application. These
  | routes are loaded by the RouteServiceProvider within a group which
  | contains the "web" middleware group. Now create something great!
  |
  */
  
  Route::get('/', function () {
      return view('welcome');
  });
  
  Auth::routes();
  
  Route::get('/home', 'HomeController@index')-&gt;name('home');
  
  Route::post('/pusher/auth', 'HomeController@authenticate');
  </code></pre>
  
  <p>The HomeController where I am getting this error:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  use \Pusher\Pusher;
  
  class HomeController extends Controller
  {
      /**
       * Create a new controller instance.
       *
       * @return void
       */
      public function __construct()
      {
          $this-&gt;middleware('auth');
      }
  
      /**
       * Show the application dashboard.
       *
       * @return \Illuminate\Http\Response
       */
      public function index()
      {
          return view('home');
      }
  
      public function authenticate(Request $request){
          $socketId = $request-&gt;socket_id;
          $channelName = $request-&gt;channel_name;
  
          $pusher = new Pusher('7525d88e2baa6d08b175', 'c25081ca96b9033e941c', '523589', [
              'cluster' =&gt; 'ap1',
              'encrypted' =&gt; true
          ]);
  
          $presence_data = ['name' =&gt; auth()-&gt;user()-&gt;name];
          $key = $pusher-&gt;presence_auth($channelName, $socketId, auth()-&gt;id(), $presence_data);
  
          return response($key);
      }
  }
  </code></pre>
  
  <p>And finally my App.js file with the components:</p>
  
  <pre><code>import React, { Component } from 'react';
  import ReactDOM from 'react-dom';
  import MediaHandler from '../MediaHandler';
  import Pusher from 'pusher-js';
  import Peer from 'simple-peer';
  
  const APP_KEY = '7525d88e2baa6d08b175';
  
  export default class App extends Component {
      constructor(){
          super();
  
  
          this.state = {
              hasMedia: false,
              otherUserId: null
          };
  
          this.user = window.user;
          this.user.stream = null;
          this.peers = {};
  
          this.mediaHandler = new MediaHandler();
          this.setupPusher();
  
          this.callTo = this.callTo.bind(this);
          this.setupPusher = this.setupPusher.bind(this);
          this.startPeer = this.startPeer.bind(this);
      }
  
      componentWillMount(){
          this.mediaHandler.getPermissions()
          .then((stream) =&gt; {
              this.setState({hasMedia: true});
              this.user.stream = stream;
  
              try{
                  this.myVideo.srcObject = stream;
              } catch(e) {
                  this.myVideo.src = URL.createObjectURL(stream);
              }
              this.myVideo.play();
          })
      }
  
      setupPusher(){
          this.pusher = new Pusher(APP_KEY, {
              authEndpoint: '/pusher/auth',
              cluster: 'ap1',
              auth: {
                  params: this.user.id,
                  headers: {
                      'X-CSRF-Token': window.csrfToken
                  }
              }
          });
  
          this.channel = this.pusher.subscribe('presence-video-channel');
  
          this.channel.bind(`client-signal-${this.user.id}`, (signal) =&gt; {
              let peer = this.peers[signal.userId];
  
              if(peer == undefined){
                  this.setState({otherUserId: signal.userId});
                  peer = this.startPeer(signal.userId, false);
              }
              peer.signal(signal.data);
          });
      }
  
      startPeer(userId, initiator = true){
          const peer = new Peer({
              initiator,
              stream: this.user.stream,
              trickle: false
          });
  
          peer.on('signal', (data) =&gt; {
              this.channel.trigger(`client-signal-${userId}`, {
                  type: 'signal',
                  userId: this.user.id,
                  data: data
              });
          });
  
          peer.on('stream', (stream) =&gt; {
              try{
                  this.userVideo.srcObject = stream;
              } catch(e) {
                  this.userVideo.src = URL.createObjectURL(stream);
              }
              this.userVideo.play();
          });
  
          peer.on('close', () =&gt; {
              let peer = this.peers[userId];
              if(peer != undefined){
                  peer.destroy();
              }
              this.peers[userId] = undefined;
          });
  
          return peer;
      }
  
      callTo(userId){
          this.peers[userId] = this.startPeer(userId);
      }
  
  
      render() {
          return (
              &lt;div className="App"&gt;
              {[1,2,3,4].map((userId) =&gt; {
                  return this.user.id != userId ? &lt;button key={userId} onClick={() =&gt; this.callTo(userId)}&gt;Call {userId}&lt;/button&gt; : null
              })}
                  &lt;div className="video-container"&gt;
                      &lt;video className="my-video" ref={(ref) =&gt; {this.myVideo = ref;}}&gt;&lt;/video&gt;
                      &lt;video className="user-video" ref={(ref) =&gt; {this.userVideo = ref;}}&gt;&lt;/video&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          );
      }
  }
  
  if (document.getElementById('app')) {
      ReactDOM.render(&lt;App /&gt;, document.getElementById('app'));
  }
  </code></pre>
  
  <p>Everything else is working fine interms of stream but for some reason, presence_auth() function is not being identified.</p>