-
-
Save ammezie/ddff82db5faa3a3c24f5f44ed78079d5 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
// 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