Download the PHP package cyberdeep/laravel-agora-token-generator without Composer
On this page you can find all versions of the php package cyberdeep/laravel-agora-token-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cyberdeep/laravel-agora-token-generator
More information about cyberdeep/laravel-agora-token-generator
Files in cyberdeep/laravel-agora-token-generator
Package laravel-agora-token-generator
Short Description Laravel package for generating Agora.io tokens (RTC, RTM, Chat) with support for both V1 and V2 token formats
License MIT
Homepage https://github.com/cyberdeep/laravel-agora-token-generator
Informations about the package laravel-agora-token-generator
Laravel Agora Token Generator
Agora Token Generator With easy to use Service Class for Laravel applications. This package supports both Agora V1 and V2 token generation, including V2 tokens that start with "007".
Requirements
- PHP 8.0.2 or higher
- Laravel 8.x, 9.x, 10.x, 11.x, or 12.x
Installation
From Packagist
If you encounter stability issues, you can explicitly allow dev stability:
Local Installation
For instructions on how to install this package locally during development, please see LOCAL_INSTALLATION.md.
Configuration
After installing the package, publish the configuration file:
Then, add your Agora credentials to your .env
file:
Usage
Programmatic Usage
The token generation method will use either V1 or V2 based on your configuration setting (AGORA_TOKEN_BUILDER
).
Console Command
You can also generate tokens directly from the command line:
Options:
--join
: Generate a token for a subscriber (audience) instead of a publisher (host)--audio-only
: Generate a token for audio-only mode
For more detailed examples and usage instructions, see examples/generate_token.md.
Standalone Token Generator
If you need to generate tokens without Laravel integration, you can use the standalone token generator:
The --v2
flag enables Agora V2 token generation, which produces tokens that start with "007".
For more information about the standalone token generator, see standalone_token_generator.md.
Token Versions
This package supports two versions of Agora tokens:
V1 Tokens
- Generated using the
RtcTokenBuilder
class - Default token version if not specified
- Set
AGORA_TOKEN_BUILDER=v1
in your.env
file
V2 Tokens
- Generated using the
RtcTokenBuilder2
class - Tokens start with "007"
- Provides enhanced security and features
- Set
AGORA_TOKEN_BUILDER=v2
in your.env
file
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security
Please see SECURITY for more information about security.
Credits
- Fady Mondy
License
The MIT License (MIT). Please see License File for more information.