PHP (Laravel)
The PHP/Laravel SDK integration guide for APIToolkit. It monitors incoming traffic, gathers the requests and sends the request to the apitoolkit servers.
Installation
Run the following command to install the package:
composer require apitoolkit/apitoolkit-php
Set the APITOOLKIT_KEY
environment variable to your API key in you .env
file, should look like this:
APITOOLKIT_KEY=xxxxxx-xxxxx-xxxxxx-xxxxxx-xxxxxx
Usage
Register the middleware in the app/Http/Kernel.php
file under the correct middleware group eg api
, or at the root:
<?php
@@ -83,4 +86,6 @@ Route::get('/', function () {
Requirements
- For laravel, apitoolkit uses the cache to prevent reinitializing the sdk with each request. So make sure you have laravel cache setup for your service