dev-master
9999999-devfor when it all comes tumbling down...
MIT
The Development Requires
by Dan Harper
Wallogit.com
2017 © Pedro Peláez
for when it all comes tumbling down...
for when it all comes tumbling down..., (*3)
A collection of Exceptions roughly mapping to HTTP response status codes., (*4)
Also comes with a JSON formatter middleware for Laravel 5.x, (*5)
If your entire application serves JSON (i.e. it's entirely an API) you can use this as an application-level Middleware. Add to your Kernel:, (*6)
protected $middleware = [ // ... \Radweb\Tumble\FormatExceptionsMiddleware::class, // ... ];
If only a portion of your application serves JSON (i.e. you also have HTML views) you can use this a Route Middleware. Add to your Kernel:, (*7)
protected $routeMiddleware = [ // ... 'jsonExceptions' => \Radweb\Tumble\FormatExceptionsMiddleware::class, // ... ];
Then add the Middleware to your routes:, (*8)
Route::group(['prefix' => '/api', 'middleware' => ['jsonExceptions']], function() {
Route::get('/', function() {
// ...
});
});
for when it all comes tumbling down...
MIT