-
-
Save BrightnBubbly/e2b8815fac25a7bbb08ac09d7086beed 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
<?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