lix-url/php-sdk
Composer 安装命令:
composer require lix-url/php-sdk
包简介
Official PHP SDK for the Lix.li API.
README 文档
README
Official PHP SDK for the Lix.li API.
Lix.li is a URL shortening and link analytics platform with support for custom aliases, groups, tags, UTM parameters and detailed click tracking.
Requirements
- PHP 8.2+
- Composer
Installation
composer require lix-url/php-sdk
Quick Start
use Lix\Client; $client = new Client('lix_live_xxx'); $link = $client->links()->create('https://example.com'); echo $link->link->shortUrl;
Profile
Get information about the authenticated account.
$profile = $client->profile()->get(); echo $profile->user->email;
Links
Create a Link
$link = $client->links()->create( url: 'https://example.com' ); echo $link->link->shortUrl;
Create a Link with Custom Alias
$link = $client->links()->create( url: 'https://example.com', alias: 'my-link' );
Create a Link with UTM Parameters
$link = $client->links()->create( url: 'https://example.com', utm: [ 'source' => 'newsletter', 'medium' => 'email', 'campaign' => 'summer-sale', ] );
Get a Link
$link = $client->links()->get(123); echo $link->url; echo $link->shortUrl;
Update a Link
$link = $client->links()->update( id: 123, title: 'Updated title' );
Delete a Link
$client->links()->delete(123);
List Links
$linksResponse = $client->links()->list(); foreach ($linksResponse->links as $link) { echo $link->shortUrl . PHP_EOL; }
Pagination
$links = $client->links()->list( limit: 100, fromId: 500 );
Groups
Create a Group
$group = $client->groups()->create( name: 'Marketing' ); echo $group->name;
Create a Rotating Group
$group = $client->groups()->create( name: 'Landing Pages', isRotate: true );
Get a Group
$group = $client->groups()->get(10);
Update a Group
$group = $client->groups()->update( groupId: 10, description: 'Updated description' );
Delete a Group
$client->groups()->delete(10);
List Groups
$response = $client->groups()->list(limit: 10, fromId: 1000); foreach ($response->groups as $group) { echo $group->name . PHP_EOL; }
Error Handling
use Lix\Exceptions\UnauthorizedException; use Lix\Exceptions\ValidationException; try { $client->links()->create( url: 'invalid-url' ); } catch (ValidationException $e) { // Validation failed // Validation error fields data var_dump($e->data); } catch (UnauthorizedException $e) { // Invalid API key }
Documentation
- API Documentation: https://lix.li/api
- OpenAPI Specification: https://github.com/lix-url/openapi
Other SDKs
- Go SDK: https://github.com/lix-url/go-sdk
- JavaScript SDK: https://github.com/lix-url/js-sdk
- Python SDK: https://github.com/lix-url/python-sdk
Support
Need help with the API or SDK?
- Support Center: https://lix.li/support
License
MIT
lix-url/php-sdk 适用场景与选型建议
lix-url/php-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 06 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「analytics」 「sdk」 「URL-Shortener」 「lix」 「links-management」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 lix-url/php-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 lix-url/php-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 lix-url/php-sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
Analytics chooser extensions for site settings.
A Laravel Nova Card to show Fathom Analytics stats.
Laravel 5 package to retrieve Google Analytics data.
Scout Extended extends Laravel Scout adding algolia-specific features
PHP library for Bluelabs Erwin
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 33
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-08