Skip to content

Middleware PSR-15 compliant which handle Whoops library

License

Notifications You must be signed in to change notification settings

woody-labs/middleware-whoops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Middleware Whoops

Whoops is a nice little library that helps you develop and maintain your projects better, by helping you deal with errors and exceptions in a less painful way.

https://filp.github.io/whoops/

Whoops

Installation

To make this middleware work, you need to include the filp/whoops in your project.

composer require --dev filp/whoops

Implementation

Any exception thrown in deeper middleware will be caught by Whoops to generate a dedicated page.

// @todo: generate request

$debug = true;

// Dispatch request into middleware stack.
$dispatcher = new Dispatcher($debug);
$dispatcher->pipe(new WhoopsMiddleware(true));
$dispatcher->pipe(new MyAppMiddleware());

// @todo: add other middleware

$response = $dispatcher->handle($request);

About

Middleware PSR-15 compliant which handle Whoops library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages