- How do I install Ignition in a Laravel project?
- Use Composer to install the dedicated Laravel package: `composer require spatie/laravel-ignition`. The package auto-registers itself during installation, replacing Laravel’s default error pages. No manual middleware setup is required for basic usage.
- Does Ignition work with Laravel 10+ and the latest PHP versions?
- Yes, Ignition supports Laravel 9/10 and PHP 8.0+. The package is regularly updated to align with Laravel’s latest features, including first-party error handling improvements. Check the [GitHub releases](https://github.com/spatie/ignition/releases) for version-specific notes.
- Can I use Ignition in production without exposing sensitive data?
- Absolutely. Ignition should **never** be enabled in production by default. Use `APP_DEBUG=false` in your `.env` or explicitly call `Ignition::configure(fn (Ignition $ignition) => $ignition->shouldDisplayException(false))` to disable it. For production errors, pair it with Flare for secure logging.
- How do I customize the error page’s appearance (e.g., dark mode, branding)?
- Ignition supports dynamic theming via `Ignition::configure(fn ($ignition) => $ignition->setTheme('dark'))`. For deeper customization, override the Blade views in `resources/views/vendor/ignition/` or use CSS variables. The package also allows hiding specific paths (e.g., APIs) with `->ignorePaths(['/api/*'])`.
- What’s the performance impact of Ignition in development?
- Ignition adds ~50–100ms to request time in development due to UI rendering and solution processing (e.g., AI fixes). This is negligible for local debugging but can be disabled entirely in CI/CD by setting `APP_DEBUG=false` or using `->disableInProduction()`.
- How do I integrate Ignition with Flare for error monitoring?
- Install Flare (`composer require spatie/laravel-flare`) and configure it in `config/flare.php`. Ignition automatically forwards exceptions to Flare when `APP_DEBUG=true`. Ensure sensitive data (e.g., passwords) is censored in Flare’s config under `censor` and `ignore_paths`.
- Can I use Ignition without Laravel (e.g., standalone PHP or Symfony)?
- Yes, the standalone `spatie/ignition` package works with any PHP app. Register it manually in your bootstrap file: `Ignition::make()->register()`. For Symfony, use the dedicated [Symfony Ignition Bundle](https://github.com/spatie/symfony-ignition-bundle). Non-Laravel setups require manual middleware configuration.
- How do I disable Ignition for specific routes (e.g., APIs or CLI commands)?
- Use the `ignorePaths()` method during configuration: `Ignition::configure(fn ($ignition) => $ignition->ignorePaths(['/api/*', 'artisan']))`. This prevents Ignition from processing errors in excluded routes, reducing unnecessary overhead. Works for both web and CLI environments.
- What are the risks of enabling the OpenAI integration for AI-driven fixes?
- The OpenAI integration adds latency (~200–500ms per request) and potential costs for high-error volumes. It also introduces a third-party dependency. Mitigate risks by disabling it in production (`->disableOpenAIFixes()`) or using a cached fallback. Avoid sending PII by configuring `->useCache(true)`.
- How do I test Ignition in a CI/CD pipeline or headless environment?
- Disable Ignition in CI/CD by setting `APP_DEBUG=false` or explicitly configuring it: `Ignition::configure(fn ($ignition) => $ignition->shouldDisplayException(false))`. For headless environments (e.g., APIs), exclude routes with `ignorePaths()` and avoid loading frontend assets by using `--ignore-paths` in your build process.