Skip to content

Pretty error pages for both development and production for Laravel 5

License

Notifications You must be signed in to change notification settings

janusnic/Laravel-Exceptions

 
 

Repository files navigation

Laravel Exceptions

Laravel Exceptions was created by, and is maintained by Graham Campbell, and provides pretty error pages for both development and production for Laravel 5. It utilises the Whoops package for the development error pages. Feel free to check out the change log, releases, license, and contribution guidelines.

Laravel Exceptions

Build Status Coverage Status Quality Score Software License Latest Version

Installation

PHP 5.5+ or HHVM 3.6+, and Composer are required.

To get the latest version of Laravel Exceptions, simply add the following line to the require block of your composer.json file:

"graham-campbell/exceptions": "~4.0"

You'll then need to run composer install or composer update to download it and have the autoloader updated.

Once Laravel Exceptions is installed, you need to register the service provider. Open up config/app.php and add the following to the providers key.

  • 'GrahamCampbell\Exceptions\ExceptionsServiceProvider'

You then MUST change your App\Exceptions\Handler class to extend GrahamCampbell\Exceptions\ExceptionHandler rather than extending Illuminate\Foundation\Exceptions\Handler.

Configuration

Laravel Exceptions supports optional configuration.

To get started, you'll need to publish all vendor assets:

$ php artisan vendor:publish

This will create a config/exceptions.php file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.

There are three config options:

Exception Transformers

This option ('transformers') defines each of the exception transformers setup for your application. This allows you to turn your exceptions into other exceptions such as exceptions for perfect results when passed to the displayers. Note that this list is processed in order and subsequent transformers can still modify the results of previous ones if required.

Exception Displayers

This option ('displayers') defines each of the exception displayers setup for your application. These displayers are sorted by priority. Note that when we are in debug mode, we will select the first valid displayer from the list, and when we are not in debug mode, we'll filter out all verbose displayers, then select the first valid displayer from the new list.

Displayer Filters

This option ('filters') defines each of the filters for the displayers. This allows you to apply filters to your displayers in order to work out which displayer to use for each exception. This includes things like content type negotiation.

Default Displayer

This option ('default') defines the default displayer for your application. This displayer will be used if your filters have filtered out all the displayers, otherwise leaving us unable to displayer the exception.

Usage

There is currently no usage documentation for Laravel Exceptions, but we are open to pull requests.

License

Laravel Exceptions is licensed under The MIT License (MIT).

About

Pretty error pages for both development and production for Laravel 5

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 95.2%
  • HTML 4.8%