• Stars
    star
    588
  • Rank 76,022 (Top 2 %)
  • Language
    PHP
  • License
    MIT License
  • Created almost 10 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Provides a powerful error response system for Laravel

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. It optionally utilises the Whoops package for the development error pages. Feel free to check out the change log, releases, security policy, license, code of conduct, and contribution guidelines.

Banner

Build Status StyleCI Status Software License Packagist Downloads Latest Version

Installation

This version requires PHP 7.4-8.2 and supports Laravel 8-10.

Exceptions L5.5 L5.6 L5.7 L5.8 L6 L7 L8 L9 L10
11.3
12.1
13.1
14.1
15.2
16.0
17.0

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

$ composer require "graham-campbell/exceptions:^17.0"

Once installed, if you are not using automatic package discovery, then you need to register the GrahamCampbell\Exceptions\ExceptionsServiceProvider service provider in your config/app.php.

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:^2.15" --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.

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 email to [email protected]. All security vulnerabilities will be promptly addressed. You may view our full security policy here.

License

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

For Enterprise

Available as part of the Tidelift Subscription

The maintainers of graham-campbell/exceptions and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.

More Repositories

1

Laravel-Markdown

A CommonMark wrapper for Laravel
PHP
1,309
star
2

Laravel-Throttle

A rate limiter for Laravel
PHP
700
star
3

Laravel-GitHub

A GitHub API bridge for Laravel
PHP
599
star
4

Laravel-Flysystem

A Flysystem bridge for Laravel
PHP
484
star
5

Laravel-DigitalOcean

A DigitalOcean API bridge for Laravel
PHP
458
star
6

Result-Type

An implementation of the result type
PHP
453
star
7

Laravel-Manager

Providing some manager functionality for Laravel
PHP
385
star
8

Laravel-Security

A wrapper of voku/anti-xss for Laravel
PHP
227
star
9

Laravel-Binput

An input protector for Laravel
PHP
172
star
10

Laravel-GitLab

A GitLab API bridge for Laravel
PHP
135
star
11

Guzzle-Factory

A simple Guzzle factory
PHP
91
star
12

Laravel-Bitbucket

A Bitbucket API bridge for Laravel
PHP
75
star
13

Laravel-TestBench

Providing some testing functionality for Laravel
PHP
49
star
14

Laravel-Example

PHP
30
star
15

Analyzer

Checks if referenced classes really exist
PHP
28
star
16

Packagist-Stats

A CLI Tool To Display Download Stats For Packagist Packages
PHP
27
star
17

Security-Core

A wrapper of voku/anti-xss for general use
PHP
23
star
18

GitHub-Notifications

Reduce your notification burden on GitHub
PHP
22
star
19

Cache-Plugin

A simple HTTP cache plugin with good defaults
PHP
16
star
20

Laravel-TestBench-Core

Providing some testing functionality for Laravel
PHP
14
star
21

Matrices

Adds matrix algebra to php
PHP
13
star
22

Envelope-Encryption

Symmetric envelope encryption using AWS KMS
PHP
9
star
23

Bounded-Cache

A bounded TTL PSR-16 cache implementation
PHP
9
star
24

Sudoku

An open source implementation of sudoku
Python
6
star
25

PHP8

Shell
4
star
26

GrahamCampbell

Hi there 👋
4
star