LaravelPackages.net
Acme Inc.
Toggle sidebar
inspector-apm/inspector-laravel

Code Execution Monitoring, built for developers.

2.118.202
235
4.19.3
About inspector-apm/inspector-laravel

inspector-apm/inspector-laravel is a Laravel package for code execution monitoring, built for developers.. It currently has 235 GitHub stars and 2.118.202 downloads on Packagist (latest version 4.19.3). Install it with composer require inspector-apm/inspector-laravel. Discover more Laravel packages by inspector-apm or browse all Laravel packages to compare alternatives.

Last updated

Inspector | Code Execution Monitoring Tool

Total Downloads Latest Stable Version License Contributor Covenant

Before moving on, please consider giving us a GitHub star ⭐️. Thank you!

Code Execution Monitoring for Laravel applications.

Requirements

  • PHP >= 8.1
  • Laravel >= 9.0

Install

Install the latest version by:

composer require inspector-apm/inspector-laravel

For Lumen

If your application is based on Lumen you need to manually register the InspectorServiceProvider:

$app->register(\Inspector\Laravel\InspectorServiceProvider::class);

Configure the Ingestion Key

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.

Attach the Middleware

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();

Test everything is working

Run the command below:

php artisan inspector:test

Go to https://app.inspector.dev to explore your data.

Agentic Integration

You can connect the Inspector library documentation to your coding assistant as a Model Context Protocol (MCP) server.

It makes it easy for tools like Claude Code, Cursor, and VS Code extensions reliably understand what Inspector client library can do, its configurations, how to use it.

AI Assisted Integration

Official documentation

Check out the official documentation

Contributing

We encourage you to contribute to Inspector! Please check out the Contribution Guidelines about how to proceed. Join us!

LICENSE

This package is licensed under the MIT license.

Star History Chart