Installing Ignition
On this page, you'll learn how to install Ignition in your project
Laravel apps
In Laravel applications, Ignition is installed by default.
Optionally, you could publish the ignition
and flare
config file to have fine-grained control over how Ignition behaves.
php artisan vendor:publish --tag="ignition-config"
php artisan vendor:publish --tag="flare-config"
Non-Laravel apps
In a non-Laravel PHP application, you can install Ignition via Composer.
composer require spatie/ignition
Here's a minimal example on how to register ignition.
use Spatie\Ignition\Ignition;
include 'vendor/autoload.php';
Ignition::make()->register();
In order to display the Ignition error page when an error occurs in your project, you must add this code. Typically, this would be done in the bootstrap part of your application.
Spatie\Ignition\Ignition::make()->register();
Setting the application path
When setting the application path, Ignition will trim the given value from all paths. This will make the error page look more cleaner.
Spatie\Ignition\Ignition::make()
->applicationPath($basePathOfYourApplication)
->register();
Using dark mode
By default, Ignition uses a nice white based theme. If this is too bright for your eyes, you can use dark mode.
Spatie\Ignition\Ignition::make()
->useDarkMode()
->register();
Stack trace arguments
By default, Ignition will show you arguments which are passed to functions and methods in the stack trace. You can find more about how this works in the stack trace arguments section.
Avoid rendering Ignition in a production environment
You don't want to render the Ignition error page in a production environment, as it potentially can display sensitive information.
To avoid rendering Ignition, you can call shouldDisplayException
and pass it a falsy value.
Spatie\Ignition\Ignition::make()
->shouldDisplayException($inLocalEnvironment)
->register();