Laas is a PHP package for sending logs to the LAAS API.
You can install Laas using Composer:
composer require peteradeojo/laas
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).
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.
Contributions are welcome! If you find a bug or want to add a new feature, please open an issue or submit a pull request.
Laas is open-source software licensed under the MIT license.