jeybin/apiresponse
最新稳定版本:v1.5
Composer 安装命令:
composer require jeybin/apiresponse
包简介
Laravel api response helper
README 文档
README
Installation
You can install the package via composer:
composer require jeybin/apiresponse
To publish providers and to copy the config files run :
php artisan apiresponse:install
Usage
If you want to get the response as array you can use:
\Jeybin\Apiresponse\ThrowResponse::status(200) ->message('User defined message') ->get(['can send array or string or empty'])
or else if you want to throw the response you can use:
\Jeybin\Apiresponse\ThrowResponse::status(200) ->message('User defined message') ->throw(['can send array or string or empty'])
Without message
\Jeybin\Apiresponse\ThrowResponse::status(200) ->throw(['can send array or string or empty'])
\Jeybin\Apiresponse\ThrowResponse::status('success')->throw()
Some of the status codes are already defined in the config/jeybin-apiresponse.php file, if you want to add more update that file
统计信息
- 总下载量: 111
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-01-10