disintegrations/eitaa-serializer-laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

disintegrations/eitaa-serializer-laravel

Composer 安装命令:

composer require disintegrations/eitaa-serializer-laravel

包简介

Laravel client for serializing Eitaa TL requests and sending them to the Eitaa gateway.

README 文档

README

Package CI

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 flags bits from the schema.
  • long values should be strings when they can exceed PHP integer range.
  • bytes, int128, int256, and int512 can 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.

统计信息

  • 总下载量: 58
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固