Before moving on, please consider giving us a GitHub star ⭐️. Thank you!
Code Execution Monitoring for Laravel applications.
- Requirements
- Install
- Configure the Ingestion Key
- Middleware
- Test everything is working
- Official Documentation
- Contribution Guidelines
- PHP >= 7.2.0
- Laravel >= 5.5
Install the latest version by:
composer require inspector-apm/inspector-laravel
If your application is based on Lumen you need to manually register the InspectorServiceProvider
:
$app->register(\Inspector\Laravel\InspectorServiceProvider::class);
First put the Ingestion Key in your environment file:
INSPECTOR_INGESTION_KEY=[ingestion key]
You can obtain an INSPECTOR_INGESTION_KEY
creating a new project in your Inspector account.
To monitor HTTP requests you should attach the WebMonitoringMiddleware
in your http application route groups.
Laravel <= 10
/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
...,
\Inspector\Laravel\Middleware\WebRequestMonitoring::class,
],
'api' => [
...,
\Inspector\Laravel\Middleware\WebRequestMonitoring::class,
]
];
Laravel >= 11
use \Inspector\Laravel\Middleware\WebRequestMonitoring;
return Application::configure(basePath: dirname(__DIR__))
->withMiddleware(function (Middleware $middleware) {
// Append the middleware
$middleware->appendToGroup('web', WebRequestMonitoring::class)
->appendToGroup('api', WebRequestMonitoring::class);
})
->create();
Run the command below:
php artisan inspector:test
Go to https://app.inspector.dev to explore your data.
Check out the official documentation
We encourage you to contribute to Inspector! Please check out the Contribution Guidelines about how to proceed. Join us!
This package is licensed under the MIT license.