Code Monkey home page Code Monkey logo

laravel-exceptions's Introduction

Laravel Exceptions

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

Laravel Exceptions

StyleCI Status Build Status Coverage Status Quality Score Software License Latest Version

Installation

Laravel Exceptions requires PHP 7. This particular version supports Laravel 5.3, 5.4, or 5.5 only.

To get the latest version, simply require the project using Composer:

$ composer require graham-campbell/exceptions

Once installed, you need to register the GrahamCampbell\Exceptions\ExceptionsServiceProvider service provider in your config/app.php, or if you're using Laravel 5.5, this can be done via the automatic package discovery.

You then MUST change your App\Exceptions\Handler to extend GrahamCampbell\Exceptions\ExceptionHandler.

Whoops Support

If you want to have the debug error pages available, you're going to need to require Whoops:

$ composer require filp/whoops --dev

Our debug displayer will automatically detect the presence of Whoops. Feel free to go and have a read of our source code to give you a better understanding of how this works. Do note that we support both Whoops ^1.1 or ^2.0.

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 a few 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.

Exception Levels

This option ('levels') defines the log levels for the each exception. If an exception passes an instance of test for each key, then the log level used is the value associated with each key.

Usage

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

Security

If you discover a security vulnerability within this package, please send an e-mail to Graham Campbell at [email protected]. All security vulnerabilities will be promptly addressed.

License

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

laravel-exceptions's People

Contributors

grahamcampbell avatar harreh avatar joecohens avatar libern avatar m1guelpf avatar thomasholman avatar vinkla avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.