Inspector logo

Lumen

Build Status Latest Stable Version

Install

Install the latest version of our Laravel package by:

composer require inspector-apm/inspector-laravel

Service Provider

Register our service provider in providers array in bootstrap/app.php:

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

API Key

First put the Inspector API KEY in your environment file:

INSPECTOR_API_KEY=[api key]

Get a fresh API key by signing up for Inspector (https://app.inspector.dev/register) and creating a new project.

By default Inspector will report:

  • Database interaction for any connection
  • Queued Job execution
  • Email sent
  • Unhandled Exceptions

Monitor Web Requests

To activate web requests inspection, you can use the Inspector middleware WebRequestMonitoringso you are free to decide which routes need to be monitored based on your routes configuration or on your personal monitoring preferences.

Attach the middleware in the Http\Kernel class:

use Inspector\Laravel\Middleware\WebRequestMonitoring;

/**
 * The application's route middleware groups.
 *
 * @var  array
 */
protected $middlewareGroups = [
    'web' => [
        ...,
        WebRequestMonitoring::class,
    ],

    'api' => [
        ...,
        WebRequestMonitoring::class,
    ]
]

Continue in Laravel documentation