{"id":37008867,"url":"https://github.com/otherguy/laravel-error-handler","last_synced_at":"2026-01-14T00:50:37.887Z","repository":{"id":57081143,"uuid":"59637521","full_name":"otherguy/laravel-error-handler","owner":"otherguy","description":"Laravel 5.2/5.3 package for better exception handling.","archived":true,"fork":false,"pushed_at":"2019-01-09T11:01:51.000Z","size":772,"stargazers_count":15,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-05T17:54:52.590Z","etag":null,"topics":["error-handler","laravel","laravel-52","laravel-53","laravel-package","whoops"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/otherguy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-25T06:39:56.000Z","updated_at":"2023-01-28T16:39:38.000Z","dependencies_parsed_at":"2022-08-24T14:42:32.016Z","dependency_job_id":null,"html_url":"https://github.com/otherguy/laravel-error-handler","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/otherguy/laravel-error-handler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otherguy%2Flaravel-error-handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otherguy%2Flaravel-error-handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otherguy%2Flaravel-error-handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otherguy%2Flaravel-error-handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/otherguy","download_url":"https://codeload.github.com/otherguy/laravel-error-handler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otherguy%2Flaravel-error-handler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28407214,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["error-handler","laravel","laravel-52","laravel-53","laravel-package","whoops"],"created_at":"2026-01-14T00:50:37.261Z","updated_at":"2026-01-14T00:50:37.879Z","avatar_url":"https://github.com/otherguy.png","language":"PHP","readme":"[![Maintained: no](https://img.shields.io/maintenance/no/2017.svg?style=flat-square)](http://unmaintained.tech/)\n[![Latest Stable Version](https://img.shields.io/packagist/v/winternight/laravel-error-handler.svg?style=flat-square)](https://packagist.org/packages/winternight/laravel-error-handler) [![License](https://img.shields.io/dub/l/vibe-d.svg?style=flat-square)](license.md) [![Downloads](https://img.shields.io/packagist/dt/winternight/laravel-error-handler.svg?style=flat-square)](https://packagist.org/packages/winternight/laravel-error-handler)\n\n# ⚠️ No longer maintained\n\nFortunately, [Laravel 5.5 has brought back the *Whoops* error handler](https://laravel-news.com/whoops-laravel-5-5) and this has continued throughout Laravel 5.6 and now 5.7.\n\nThis repository and package can still be used for Laravel 5.2 and 5.3 and will continue to work. I will not add Laravel 5.4 support because [Laravel 5.4 itself is no longer supported](https://laravel.com/docs/5.7/releases#support-policy).\n\nIssue reports and pull requests on this repository will not be attended.\n\n# Laravel 5.2/5.3 Error Handler\n\nUnlike version 4, Laravel 5 no longer uses [Whoops](https://github.com/filp/whoops \"filp/whoops\") error handling out of\nthe box and instead relies on the Symfony error handler, which is far less\ninformative for developers.\n\nThis packages provides a convenient way to get the more informative [Whoops](https://github.com/filp/whoops \"filp/whoops\") \nerror messages back in your Laravel 5.2/5.3 project, along with a few other goodies.\n\n![Exception](screenshot.png \"The Whoops Error Handler in Action!\" )\n\n## Features\n\n* Optional [Whoops](https://github.com/filp/whoops \"filp/whoops\") 1.1 or 2.1 exception handler in debug mode\n* Standard (and configurable) error views in production mode\n* Provides AJAX-compatible JSON error responses in case of an exception (including HTTP exceptions)\n* Fires an event for each exception, providing full access to the exception\n* Compatibility with [Laravel Debug Bar](https://github.com/barryvdh/laravel-debugbar \"barryvdh/laravel-debugbar\")\n\n## Installation\n\nTo get the latest version of Laravel Error Handler, simply require the project using Composer:\n\n```bash\n$ composer require winternight/laravel-error-handler\n```\n\nInstead you can of course manually update the `require` block in your `composer.json` and add the `laravel-error-handler` package.\n\n```json\n\"require\": {\n    \"winternight/laravel-error-handler\": \"^1\"\n},\n```\n\n### Whoops\n\nWhoops itself is an optional dependency and you can do without Whoops on production. To install it, simply run:\n\n```bash\n$ composer require filp/whoops --dev\n```\n\nBoth Whoops `^1.1` and `^2.1` are supported but I strongly recommend you use the latest version, especially if you already use PHP 7.\n\n## Configuration \n\nAdd the service provider in your `config/app.php` :\n\n```php\n...\nWinternight\\LaravelErrorHandler\\ServiceProvider::class,\n...\n```\n\nYou then need to change your `App\\Exceptions\\Handler` class to extend `Winternight\\LaravelErrorHandler\\Handlers\\ExceptionHandler` rather than extending `Illuminate\\Foundation\\Exceptions\\Handler`.\n\n```php\n\u003c?php namespace App\\Exceptions;\n\nuse Exception;\nuse Illuminate\\Validation\\ValidationException;\nuse Illuminate\\Auth\\Access\\AuthorizationException;\nuse Illuminate\\Database\\Eloquent\\ModelNotFoundException;\nuse Symfony\\Component\\HttpKernel\\Exception\\HttpException;\n\nuse Winternight\\LaravelErrorHandler\\Handlers\\ExceptionHandler as ExceptionHandler;\n\nclass Handler extends ExceptionHandler\n{\n...\n```\n\nThats it — better error handling for your Laravel 5 project!\n\n## Usage\n\nNormally, you don't have to do anything special. As long as debug mode is enabled in your Laravel application (that is, \n`app.debug` is set to `true`) and Whoops is installed, you should see the Whoops error handler.\n\n### Debug Mode vs. Plain Mode\n\nIn debug mode, the Whoops handler is being shown. Since it exposes a lot of information about your system, your source \ncode and potentially even passwords to your database and other services (depending on what you store in your `.env` file\nand thus your environment variables), debug mode should never, *ever* be enabled on a production environment (or any \nenvironment that is exposed to the outside world).\n\nIf `app.debug` is enabled and Whoops is not installed, it will fall back to the Laravel 5 way of displaying exceptions.\n\nBecause you will proably need pretty error pages for your application anyway, this package takes care of that for you. \nIf debug mode is disabled (`app.debug` is set to `false`), an error view is rendered instead. By default, the view being\nrendered is `errors.error` (that will be `views/errors/error.blade.php` for most of us). If you want to change that, you \ncan set a view in `config/view.php` like this (this example would use the `views/error/exception.blade.php` view):\n\n```php\nreturn [\n    // ...\n    'error' =\u003e 'errors.exception',\n];\n```\n\n### HTTP Exceptions\n\nFor HTTP exceptions like `404`, `403` and so on, the package will try to find a corresponding view. For example, to use \na different view for `404` errors, you can simply create a `views/errors/404.blade.php` file and it will be used \nautomatically.\n\n### Maintenance Mode\n\nBy default, Laravel [uses a custom view](https://laravel.com/docs/5.2/configuration#maintenance-mode) in maintenance mode\nto make it easy to disable your application while it's updating. The default template for maintenance mode responses is \nlocated in `views/errors/503.blade.php`. If you remove that file, this package still has you covered: Laravel's \nmaintenance mode simply throws an exception with a `503` HTTP status code, so you will be shown the default error view \nwhen your application's debug mode is off. With debug mode turned on, you will be shown the actual exception with the \nWhoops error handler.\n\n## Events\n\nWhenever an error occurs, an `ExceptionEvent` is raised. You can use your `EventServiceProvider` to listen to this type\nof event if you wish:\n\n\n```php\n    protected $listen = [\n        'Winternight\\LaravelErrorHandler\\Events\\ExceptionEvent' =\u003e [\n            'App\\Listeners\\ExceptionEventListener',\n        ],\n    ];\n```\n\n## Is this compatible with [Laravel Debug Bar](https://github.com/barryvdh/laravel-debugbar \"barryvdh/laravel-debugbar\")?\n\nI'm glad you asked! Yes, it is. The debug bar simply renders on top of the Whoops error page. You can also use the Event\nthat is being fired whenever an exception occurs to add it to your debug bar. Here's a small example which you can put\nin your `EventServiceProvider`'s `boot()` method:\n\n```php\n\\Event::listen( 'Winternight\\LaravelErrorHandler\\Events\\ExceptionEvent', function ( $event ) {\n    \\Debugbar::addException( $event-\u003egetException() );\n} );\n```\n\n## Troubleshooting\n\nIf you're not seeing any difference (and you have made sure there actually is an error being thrown, you probably have \ndebugging disabled. That means that Laravel will (and should) not disclose any details regarding the error that has \noccurred. It's for your own protection.\n\nTo enable Whoops, open up your `config/app.php` configuration file, find the `debug` setting and change it to `true`. As\nsoon as you encounter an error, you will see the Whoops error handler. If you have done everything right, you should\nprobably use the `.env` file to set the `APP_DEBUG` environment variable.\n\n## What about AJAX requests?\n\nWhenever an AJAX request triggers the error handler, it will be recognized and the so called `PrettyPageHandler` will be\nexchanged for a `JsonResponseHandler` that returns a JSON response that you can parse on the client side. You can read \n[more here](https://github.com/filp/whoops/blob/master/docs/API%20Documentation.md#-whoopshandlerjsonresponsehandler).\nIf debug mode is turned off, a different JSON object will be returned instead that still allows you to gracefully handle\nyour AJAX errors, while not giving out any information about your code.\n\nHere is a (very) simple jQuery snippet for global AJAX error handling:\n\n```js\n$( document ).ajaxError(function( evt, xhr ) {\n    console.log( xhr.responseJSON.error );\n} );\n```\n\nThe JSON object will always contain an `error` property which in turn will always at least contain the `type` and `message`\nproperties. If debug mode is enabled, it will additionally contain the `file` and `line` properties and — in case of an \nException — also the `trace` property. The `trace` property contains the full exception stack trace.\n\n## What about errors in the console?\n\nThe package is smart enough not to mess with output to the console. Enjoy your errors in plain text!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotherguy%2Flaravel-error-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fotherguy%2Flaravel-error-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotherguy%2Flaravel-error-handler/lists"}