smskin/clico
Composer 安装命令:
composer require smskin/clico
包简介
PHP interface for cli.co url shorter service
README 文档
README
Installation
Laravel
- composer require smskin/clico
- add lines to the config/services.php
'clico' => [
'api_token'=>env('CLICO_API_TOKEN','')
]
- add CLICO_API_TOKEN to .env file
CLICO_API_TOKEN=[API TOKEN]
- You can use the CliCo facade
try {
$link = CliCo::singleLink(
(new LinkRequest())
->setTargetUrl('https://msk.wed-expert.com')
->setUtm(
(new UtmModel())
->setPhone('7911111111111')
)
);
} catch (HttpException $exception){
dd($exception);
} catch (ValidationException $exception){
dd($exception);
}
Any PHP service
- composer require smskin/clico
- You can use the library as any class
try {
$link = (new CliCo(
'[API TOKEN]'
))->singleLink(
(new LinkRequest())
->setTargetUrl('https://msk.wed-expert.com')
->setUtm(
(new UtmModel())
->setPhone('7911111111111')
)
);
} catch (HttpException $exception){
dd($exception);
} catch (ValidationException $exception){
dd($exception);
}
Using
- singleLink
- multipleLinks
统计信息
- 总下载量: 528
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-10-16