peteradeojo/laas-php-sdk
最新稳定版本:v2.2.1
Composer 安装命令:
composer require peteradeojo/laas-php-sdk
包简介
A PHP SDK for the LAAS API
README 文档
README
Laas is a PHP package for sending logs to the LAAS API.
Installation
You can install Laas using Composer:
composer require peteradeojo/laas
Usage
First, you need to create an instance of the Laas class:
$laas = Laas::getInstance();
Then, you can use the sendLog method to send a log to the LAAS API:
$log = new LaasLogDTO(); $log->level = 'info'; $log->message = 'This is a test message'; $response = $laas->sendLog($log);
The sendLog method returns a Guzzle HTTP response, which you can use to check the status code and response body (or you can completely ignore it).
How to get the LAAS_APP_TOKEN
To get the app token you will need to
- visit Lags
- Create an account on the platform
- Log in to the account you just created
- Create an app from your dashboard and put in the name for the app e.g Hotel system
- click on generate token
- copy the token generated and use it in your application.
Note: Make sure to set the LAAS_APP_TOKEN environment key before using the sendLog method.
Contributing
Contributions are welcome! If you find a bug or want to add a new feature, please open an issue or submit a pull request.
License
Laas is open-source software licensed under the MIT license.
统计信息
- 总下载量: 97
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-06-12