-
-
Save ammezie/f80900d3b6676fa08798dd70da41bdb0 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 | |
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use GetStream\StreamChat\Client as StreamClient; | |
class ChatController extends Controller | |
{ | |
/** | |
* Generate token for clientside use | |
*/ | |
public function generateToken(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->user_id) | |
]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment