Skip to content

Instantly share code, notes, and snippets.

@ammezie ammezie/ChatController.php Secret
Created Nov 13, 2019

What would you like to do?
// app/Http/Controllers/ChatController.php
protected $client;
protected $channel;
public function __construct()
$this->client = new StreamClient(env("MIX_STREAM_API_KEY"), env("MIX_STREAM_API_SECRET"), null, null, 9);
$this->channel = $this->client->Channel("messaging", "chatroom");
public function leaveChannel(Request $request)
return $this->channel->removeMembers([$request->username]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.