Skip to content

Instantly share code, notes, and snippets.

@bayareawebpro
Created September 18, 2019 23:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bayareawebpro/159bfbb031a5c5eae28121f0c8648311 to your computer and use it in GitHub Desktop.
Save bayareawebpro/159bfbb031a5c5eae28121f0c8648311 to your computer and use it in GitHub Desktop.
/**
* Pusher API: User Online Status
* Not Implemented (may need for future use)
*/
Route::any('online', function(Request $request){
/** @var $pusher \App\PusherApi */
$pusher = app()->make('pusherApi');
$channel = $request->get('channel', 'presence-App.Job.9');
$user_id = $request->get('user_id', 2);
$status = $pusher->isOnline($channel,$user_id);
return response(array(
'message' => 'Is User Online?',
'channel' => $channel,
'user_id' => $user_id,
'status' => $status
), 200);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment