ericliao79/laravel-respond-format

规范化响应API格式。

v2.1.1 2018-05-18 01:49 UTC

README

CircleCI Total Downloads
在团队合作中,经常会遇到不同的API响应格式,laravel-respond-format整合了一些常见的响应到laravel辅助函数中,使这变得更简单和清晰。

安装

$ composer require maras0830/laravel-respond-format ^v2.0

或者

"require": {
  "maras0830/laravel-respond-format": "^v2.0" // Add this line
}

使用

return not_found();

示例:数据未找到响应

{
  "error": {
    "message": "Data not found.",
    "code": 404,
    "type": "not_found"
  }
}

文档(未完成)