Blog Detail

28

Jan
Create beautiful error pages for Laravel apps with Ignition cover image

arrow_back Create beautiful error pages for Laravel apps with Ignition

Ignition is a beautiful and customizable error page for Laravel applications. It is the default error page for new Laravel applications. It also allows you to publicly share your errors on Flare. If configured with a valid Flare API key, your errors in production applications will be tracked, and you’ll get notified when they happen.

The team at Spatie released a major new version of Ignition, the default error page for Laravel. The new version of spatie/laravel-ignition will work for Laravel 8 and 9 applications running on PHP 8.0 and above.

In Laravel 9

Laravel 9 ships with Ignition by default. When an error is thrown in a web request, you’ll automatically see our beautiful error page.

In Laravel 8

Laravel 8 ships with facade/ignition by default, which is the old version of Ignition.

To upgrade to the newest version, replace the facade/ignition dependency in your composer.json file with spatie/laravel-ignition.

Configuration

In the ignition config file, you can tweak the way the Ignition error page behaves and looks like.

Setting your editor

On a typical error screen paths to source, file names are displayed. Next to the file name is a pencil icon. Clicking the pencil icon will open that file in your editor of choice. You can configure that editor in the editor key of the ignition config file.

You can choose between phpstorm, vscode, vscode-insiders, sublime, and atom.

Theme support

You can configure a theme in the theme key of the ignition config file. Out of the box, there are two beautiful themes supported.

  • light
  • dark

Security

Ignition has the ability to run executable solutions. These solutions can make your life better by running migrations when you forgot to run them, generating an APP_KEY if you set none, fixing variable names in your code.

These runnable solutions are only available when Laravel is in debug mode.

Disable executing solutions

Should you, for some reason, do need to set debug mode to true on a non-local environment, then we highly recommend turning off Ignition’s ability to execute solutions. You can do this by setting the ignition.enable_runnable_solutions config key to false.

If you’re using Ignition v2.6.1 or higher, then it’s not possible anymore to run solutions in a non-local environment.

Some of the main features available in this new version of Ignition include:

  • Default error page for Laravel 9
  • Use the next version of Ignition in Laravel 8
  • Framework-agnostic Ignition package for PHP projects
  • Light, Dark, and auto themes
  • Save settings from the error page to the ~/.ignition.json file
  • Sticky error message always stays displayed
  • Customizable “open in editor” to open in your preferred editor
  • Collect dump() calls and displays them in a separate tab
  • Show queries made during the request with query timings
  • Sharing options for Flare

This package has a lot more features with code examples. If you want to dig more, you can visit its complete documentation on Github.

Published at : 28-01-2022

Author : Rizwan Aslam
AUTHOR
Rizwan Aslam

I am a highly results-driven professional with 12+ years of collective experience in the grounds of web application development especially in laravel, native android application development in java, and desktop application development in the dot net framework. Now managing a team of expert developers at Codebrisk.

Launch your project

Launch project