Last active
May 2, 2018 09:20
-
-
Save MrAtiebatie/9765dd2d8757d72969ce6cdfba234d64 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers\Api; | |
use Pusher\Pusher; | |
use Illuminate\Http\Request; | |
use App\Http\Controllers\Controller; | |
class BroadcastAuthController extends Controller | |
{ | |
/** | |
* Authenticate | |
* @param Request $request | |
* @return Response | |
*/ | |
public function auth(Request $request) | |
{ | |
$pusher = new Pusher( | |
config('broadcasting.connections.pusher.key'), | |
config('broadcasting.connections.pusher.secret'), | |
config('broadcasting.connections.pusher.app_id'), | |
config('broadcasting.connections.pusher.options') | |
); | |
return $pusher->socket_auth($request->channel_name, $request->socket_id); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment