disintegrations / eitaa-serializer-laravel
Laravel client for serializing Eitaa TL requests and sending them to the Eitaa gateway.
Package info
github.com/disintegrations/eitaa-serializer-laravel
pkg:composer/disintegrations/eitaa-serializer-laravel
Requires
- php: ^8.3
- ext-json: *
- ext-zlib: *
- illuminate/http: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
Requires (Dev)
- orchestra/testbench: ^10.0 || ^11.0
- pestphp/pest: ^3.0 || ^4.0
This package is auto-updated.
Last update: 2026-05-28 20:25:27 UTC
README
Laravel client for serializing Eitaa TL requests, sending them to https://sajad.eitaa.ir/eitaa/,
and deserializing the binary response.
Installation
Requires PHP 8.3 or newer and Laravel 12 or newer.
composer require disintegrations/eitaa-serializer-laravel
Laravel package discovery registers the service provider automatically.
Configuration
Publish the config when you need to override defaults:
php artisan vendor:publish --tag=eitaa-config
Available environment variables:
EITAA_GATEWAY_ENDPOINT=https://sajad.eitaa.ir/eitaa/ EITAA_LAYER=133 EITAA_DEFAULT_IMEI=00__web EITAA_TIMEOUT=30
The package uses its bundled TL schema by default. If you need to customize the schema:
php artisan vendor:publish --tag=eitaa-schema
Then set:
EITAA_SCHEMA_PATH=/absolute/path/to/resources/eitaa/schema.json
Usage
Inject or resolve the client:
use Disintegrations\EitaaSerializer\EitaaGatewayClient; $response = app(EitaaGatewayClient::class)->send( method: 'help.getConfig', params: [], token: null, imei: null, );
Or use the facade:
use Disintegrations\EitaaSerializer\Facades\Eitaa; $response = Eitaa::send('help.getConfig');
Authenticated calls:
$response = app(EitaaGatewayClient::class)->send( method: 'messages.sendMessage', params: [ 'flags' => 0, 'peer' => [ '_' => 'inputPeerUser', 'user_id' => '123456789', 'access_hash' => '987654321', ], 'message' => 'Hello', 'random_id' => (string) random_int(1, PHP_INT_MAX), ], token: $token, imei: $imei, );
TL Value Rules
- TL objects use
_for the constructor predicate, for example['_'=> 'inputPeerSelf']. - Optional fields require the correct
flagsbits from the schema. longvalues should be strings when they can exceed PHP integer range.bytes,int128,int256, andint512can be raw binary strings or arrays of byte integers.
Testing
composer install
composer test
Live Eitaa integration tests are available for no-auth methods. They are disabled by default because they call the external gateway:
EITAA_RUN_INTEGRATION=1 composer test:integration
On PowerShell:
$env:EITAA_RUN_INTEGRATION='1'; composer test:integration
The integration suite currently calls help.getConfig and help.getNearestDc without a token.