Skip to content

Instantly share code, notes, and snippets.

@BrightnBubbly
Created April 28, 2020 02:20
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/e2b8815fac25a7bbb08ac09d7086beed to your computer and use it in GitHub Desktop.
Save BrightnBubbly/e2b8815fac25a7bbb08ac09d7086beed to your computer and use it in GitHub Desktop.
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use GetStream\StreamChat\Client as StreamClient;
class TokenController extends Controller
{
public function generate(Request $request)
{
$client = new StreamClient(
env('MIX_STREAM_API_KEY'),
env('MIX_STREAM_API_SECRET'),
null,
null,
9
);
return response()->json([
'token' => $client->createToken($request->username)
]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment