The main goal of Flare is to be the best error tracker for Laravel applications. Since we started, many people are asking how they can use Flare with other PHP applications that they run and how this works. For this purpose, we released a plain PHP SDK that also powers Flares Laravel client Ignition under the hood.
In this article, we are using Flare to track errors in a Laravel Lumen application.
At first, you need to create a new project at Flare to get your Flare application key and access the Flare API. You can do this on your project overview here.
The second step is to install the Flare PHP client package via composer:
composer require facade/flare-client-php
The next step is to make sure that you are loading the default
AppServiceProvider in Lumen. The service provider is not loaded by default, but you can do that by uncommenting line
bootstrap/app.php in your Lumen project directory. It should look like this:
The last step is to send all errors from your Lumen application to Flare. This is quite simple and works by registering the Flare handlers within the
AppServiceProvider. For a default Lumen install, it looks like this:
class AppServiceProvider extends ServiceProvider
public function register()
Make sure you use your own
APP_KEY and do not add the key directly in the file as this file is version controlled, and you don't want to have credentials in there. A better practice is to add this key to the