radweb/tumble
最新稳定版本:1.1.1
Composer 安装命令:
composer require radweb/tumble
包简介
for when it all comes tumbling down...
README 文档
README
Tumble
for when it all comes tumbling down...
A collection of Exceptions roughly mapping to HTTP response status codes.
Also comes with a JSON formatter middleware for Laravel 5.x
Usage
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:
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:
protected $routeMiddleware = [ // ... 'jsonExceptions' => \Radweb\Tumble\FormatExceptionsMiddleware::class, // ... ];
Then add the Middleware to your routes:
Route::group(['prefix' => '/api', 'middleware' => ['jsonExceptions']], function() { Route::get('/', function() { // ... }); });
统计信息
- 总下载量: 407
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-07-07