Skip to content

Instantly share code, notes, and snippets.

@BrightnBubbly
Created April 28, 2020 02:16
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 BrightnBubbly/e75cc20d7411c62ac25dd6cda54657aa to your computer and use it in GitHub Desktop.
Save BrightnBubbly/e75cc20d7411c62ac25dd6cda54657aa to your computer and use it in GitHub Desktop.
use GetStream\StreamChat\Client as StreamClient;
protected function registered($user)
{
$invite = Invite::firstWhere('email', $user->email);
$invite->accepted = true;
$invite->save();
$client = new StreamClient(
env('MIX_STREAM_API_KEY'),
env('MIX_STREAM_API_SECRET'),
null,
null,
9
);
$client->updateUser([
'id' => $user->username,
'name' => $user->username,
]);
$channel = $client->Channel('messaging', 'Chatroom');
$channel->addMembers([$user->username]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment