Installation

Connect your application with Inspector.

Server requirements

  • PHP >= 7.2

  • Laravel >= 5.5

To verify what version of PHP is installed on your server run this command in your terminal: php -v

To know what is the Laravel version behind your application run this command in your application's main directory: php artisan --version

Clear the Laravel configuration

Before installing the package you should clear your Laravel configuration to avoid unexpected error loading the default package config file.

Run the command below to clear your cached configuration:

php artisan config:clear

Install

Type the command below in your terminal to install the latest version of the package:

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

Get a new Ingestion Key by signing up for Inspector (https://app.inspector.dev/register) and creating a new application.

Put the Inspector Ingestion Key in your environment file:

INSPECTOR_INGESTION_KEY=[ingestion key]

Test everything is working

Execute the test command to check if your app can send data to inspector correctly:

php artisan inspector:test

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

Background Monitoring

By default Inspector will monitor everything executed in background:

  • Queued Jobs

  • Artisan commands

  • Unhandled Exceptions

If you want learn more about background jobs monitoring take a look on our article: https://www.inspector.dev/laravel-background-jobs-commands-monitoring-with-inspector/‚Äč

Go the Http Request Monitoring section to understand how to trace your application when it's executed due to an incoming http request.