Comment on page
📽
Laravel Agora
Agora Token Generator With easy to use Service Class

composer require tomatophp/laravel-agora
publish config file
php artisan vendor:publish --tag="laravel-agora-config"
AGORA_APP_ID=
AGORA_APP_CERTIFICATE=
you can use the class to return your token like
Agora::make(id: 1)->uId(rand(999, 1999))->token();
it will generate an Audio/Video Token as a Publisher
the channel name will be
agora.USER_ID
if you went to join an existing channel use this where the id is the user you went to connect with
Agora::make(id: 1)->uId(rand(999, 1999))->join()->token();
if you went to an audio channel only use this
Agora::make(id: 1)->uId(rand(999, 1999))->join()->audioOnly()->token();
you can custom your channel name by use
Agora::make(id: 1)->uId(rand(999, 1999))->channel('custom')->token()
than your channel will be
custom.USER_ID
Last modified 9mo ago