phuongdanh / simple-response
此包用于包装您的响应数据。它也支持Laravel。
v1.1.1
2022-10-10 07:56 UTC
Requires
This package is auto-updated.
Last update: 2024-09-10 12:23:35 UTC
README
这是一个简单的包,用于在您的API中正确处理响应。此包不包含任何依赖项。
安装
通过Composer
$ composer require phuongdanh/simple-response
需求
本版本支持以下PHP版本。
- PHP 5.6
- PHP 7.0
- PHP 7.1
- PHP 7.2
- PHP 8.x
如何使用它?
// Use namespace use SimpleResponse\Response; // response with default data type based on Accept value in request's header return Response::default($your_data); // response as application/json return Response::json($your_data); // response as text/xml return Response::xml($your_data);
许可证
MIT许可证(MIT)。请参阅许可证文件以获取更多信息。