Download the PHP package loggitack/loggitrack-sdk-laravel without Composer
On this page you can find all versions of the php package loggitack/loggitrack-sdk-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download loggitack/loggitrack-sdk-laravel
More information about loggitack/loggitrack-sdk-laravel
Files in loggitack/loggitrack-sdk-laravel
Package loggitrack-sdk-laravel
Short Description LoggiTrack integration SDK for Laravel
License MIT
Informations about the package loggitrack-sdk-laravel
Loggitrack Laravel SDK
The Loggitrack Laravel SDK provides seamless integration of the Loggitrack API into your Laravel application, allowing you to track API requests and responses, analyze performance metrics, and monitor user behavior.
Installation
Prerequisites
- PHP ^8.2
- Laravel ^8.0|^9.0|^10.0
Installation Steps
-
Require the SDK via Composer:
-
Publish the configuration file:
-
Configure the SDK: Open the published configuration file
config/loggitrack.php
and update the settings as needed:Set the
LOGGITRACK_API_KEY
andLOGGITRACK_API_URL
environment variables in your.env
file:
Usage
Middleware
The SDK includes a LogRequestMiddleware
middleware that should be added to each route you want to observe. This middleware will log the requests and responses for the specified endpoints.
-
Register the Middleware: Open the
app/Http/Kernel.php
file and add the middleware to the route middleware array: - Apply the Middleware to Routes:
Apply the
loggitrack
middleware to the routes you want to observe. For example:
Example Usage
-
Set Up Observed Models: Add the models you want to observe to the
observed_models
array in the configuration file: - Send API Requests: The SDK will automatically log the requests and responses for the observed endpoints. You can use your application as usual, and the logs will be sent to the Loggitrack API for analysis.
Additional Configuration Options
The SDK provides additional configuration options that can be customized in the config/loggitrack.php
file:
- queueable: Set to
true
to queue the logging requests for asynchronous processing. Defaults tofalse
.
Troubleshooting
If you encounter any issues during the installation or usage of the Loggitrack Laravel SDK, refer to the following steps:
- Ensure all prerequisites are met.
- Verify your configuration settings in
config/loggitrack.php
. - Check the Laravel logs for any errors related to the SDK.
Contributing
Contributions are welcome! Please submit a pull request or open an issue to contribute.
License
The MIT License (MIT). Please see License File for more information.