Installation
Use the installation guide below to match your Laravel version, app structure, and optional features like performance monitoring or Vapor:
Flare supports Laravel 10, 11, 12, and 13, including performance monitoring.
This guide covers every supported setup. Follow only the steps that match your project: conditional instructions start with a bold "If ..." line describing when they apply. Steps without such a line always apply. Replace
YOUR-API-KEYwith the project's API key. You can find it in the project settings on https://flareapp.io.
Step 1: Install the package using Composer
If your project uses Laravel 10.x:
Laravel 10 projects ship with spatie/laravel-ignition, which conflicts with the Flare package. Remove it first:
composer remove spatie/laravel-ignition --dev --no-interaction
If your project uses Laravel 10.x, 11.x, 12.x, or 13.x:
composer require spatie/laravel-flare:"^3.2" --no-interaction
If your project uses Laravel 8.x:
composer remove facade/ignition --no-update --dev
If your project uses Laravel 8.x or 9.x:
composer require spatie/laravel-ignition:"^1.6" --no-interaction
If your project uses Laravel 7.x:
composer require facade/ignition --no-interaction
If your project uses Laravel 6.x:
composer require facade/ignition:"^1.16" --no-interaction
Step 2: Register Flare & configure
If your project uses Laravel 10.x:
Register Flare in the register method of your app/Providers/AppServiceProvider.php file:
In app/Providers/AppServiceProvider.php:
use Spatie\LaravelFlare\Facades\Flare;
public function register(): void
{
Flare::handles();
}
Do not call Flare::handles() from app/Exceptions/Handler.php: on Laravel 10 the register method of the exception handler runs while the handler is being constructed, which makes Flare::handles() resolve the handler recursively and crashes your application.
If your project uses Laravel 11.x, 12.x, or 13.x with the current application structure (has a bootstrap/app.php builder):
Register Flare in the withExceptions closure of your bootstrap/app.php file:
In bootstrap/app.php:
->withExceptions(function (Exceptions $exceptions) {
\Spatie\LaravelFlare\Facades\Flare::handles($exceptions);
})->create();
If your project uses Laravel 11.x, 12.x, or 13.x but kept the old (pre-11) application structure:
Register Flare in the register method of your app/Providers/AppServiceProvider.php file:
In app/Providers/AppServiceProvider.php:
use Spatie\LaravelFlare\Facades\Flare;
public function register(): void
{
Flare::handles();
}
If you want to send logs to Flare, deploy with Laravel Vapor, or use the Flare daemon (Laravel 10.x or newer):
Publish the Flare configuration file:
php artisan vendor:publish --provider='Spatie\LaravelFlare\FlareServiceProvider'
If you want to send logs to Flare (Laravel 10.x or newer):
Enable logging in your config/flare.php file:
In config/flare.php:
'log' => true,
Register the Flare log channel in your config/logging.php file:
In config/logging.php:
'flare' => [
'driver' => 'flare',
],
Add the Flare channel to the LOG_STACK variable in your .env file:
In .env:
LOG_STACK=single,flare
If you deploy with Laravel Vapor (Laravel 10.x or newer):
Switch the sender in your config/flare.php file:
In config/flare.php:
'sender' => [
'class' => \Spatie\LaravelFlare\Senders\LaravelVaporSender::class,
'config' => [],
],
If you use the Flare daemon (Laravel 10.x or newer, not on Laravel Vapor):
Send reports through the Flare daemon by switching the sender in your config/flare.php file. The daemon forwards telemetry asynchronously so Flare delivery stays off your request path:
In config/flare.php:
'sender' => [
'class' => \Spatie\FlareClient\Senders\DaemonSender::class,
'config' => [
'daemon_url' => env('FLARE_DAEMON_URL', 'http://127.0.0.1:8787'),
],
],
See the Flare daemon documentation for instructions on running the daemon on Laravel Forge, Laravel Cloud, Kubernetes, Docker, or a generic VPS.
If your project uses Laravel 6.x, 7.x, 8.x, or 9.x:
Register the Flare logger in config/logging.php:
In config/logging.php:
'flare' => [
'driver' => 'flare',
],
If your project uses Laravel 6.x, 7.x, 8.x, or 9.x and does not deploy with Laravel Vapor:
Add Flare to your logging stack in config/logging.php:
In config/logging.php:
'stack' => [
'driver' => 'stack',
'channels' => ['daily', 'flare'],
],
If your project uses Laravel 6.x, 7.x, 8.x, or 9.x and deploys with Laravel Vapor:
Add a Vapor logging channel in config/logging.php:
In config/logging.php:
'vapor' => [
'driver' => 'stack',
'channels' => ['flare', 'stderr'],
'ignore_exceptions' => false,
],
Configure Vapor logging in .env.production:
In .env.production:
LOG_CHANNEL=vapor
Step 3: Connect your project key
In .env:
FLARE_KEY=YOUR-API-KEY
Step 4: Verify your setup
Run this command to verify everything is working:
php artisan flare:test
Great! From now on, Flare will track all errors and exceptions throughout your application.
Using an older Laravel/PHP version or the old application structure?
In the past we've had multiple clients without support for performance monitoring. While these packages are still available, we recommend using the newer packages for all new projects:
- spatie/laravel-flare v1: supports PHP 8.1 and later, Laravel 11.0 and 12.0
- spatie/laravel-ignition: supports PHP 7.1 and later, Laravel 5.5 until 12.0
- spatie/flare-client-php v1: supports PHP 8.0 and later
- facade/flare-client-php v1: supports PHP 7.1 until 8.0
Using Ignition?
The current Flare client and Laravel Flare package are incompatible with Ignition. If you want to use Flare, you need to remove Ignition from your project.
Due to high demand, we are working on a new version of the Flare client that will be compatible with Ignition. We will keep you updated on our progress.
Upgrading
You can find the upgrade guide for laravel-flare on GitHub.