radweb/tumble 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

radweb/tumble

最新稳定版本:1.1.1

Composer 安装命令:

composer require radweb/tumble

包简介

for when it all comes tumbling down...

README 文档

README

Latest Stable Version License

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

GitHub 信息

  • Stars: 1
  • Watchers: 7
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-07