spatie/ignition
Beautiful, customizable error page for PHP apps. Register in one line to get a rich exception UI with stack traces, code snippets, context, and dark mode. Works standalone; see Laravel Ignition, Symfony bundle, and more integrations.
laravel-ignition package (separate repo) offers Laravel-specific optimizations (e.g., service provider integration, config publishing). This reduces boilerplate for Laravel apps.App\Exceptions\Handler level. No need to modify core Laravel files.public/index.php for Symfony-like apps). This is straightforward but may need adjustments for custom routing setups.censorRequestBodyFields and anonymizeIp() to mitigate.shouldDisplayException() be tied to environment variables (e.g., APP_ENV) or a custom flag?spatie/laravel-ignition (official package) for zero-config integration. It handles:
config/ignition.php).AppServiceProvider::boot():
if (app()->environment('local', 'staging')) {
\Spatie\Ignition\Ignition::make()->register();
}
laravel-ignition.public/index.php):
$ignition = \Spatie\Ignition\Ignition::make()
->applicationPath(base_path())
->shouldDisplayException(app()->isLocal())
->register();
$app->middleware(function ($request, $handler) use ($ignition) {
try {
return $handler->handle($request);
} catch (Throwable $e) {
$ignition->render($e);
}
});
MethodNotAllowedHttpException, ModelNotFoundException).ProvidesSolution interface works).| Component | Compatibility Notes |
|---|---|
| Laravel | Fully compatible with Laravel 8+. For older versions, use v1.x of laravel-ignition. |
| Symfony | Works with Symfony 5.4+. Bundle handles kernel events and middleware. |
| PSR-15 Middleware | Requires manual integration (see above). |
| Caching (OPcache) | No conflicts, but ensure applicationPath() is set correctly to avoid path issues. |
| Flare | Requires spatie/flare-client-php. Version alignment is critical (check docs). |
| OpenAI | Optional. Requires openai-php/client and API key management. |
| Custom Error Pages | Ignition replaces them entirely. Use shouldDisplayException(false) to opt out. |
spatie/ignition and register it in the bootstrap.applicationPath() to trim base paths from stack traces.configureFlare() (e.g., context, middleware).How can I help you explore Laravel packages today?