定制 decodeblock/api-utility 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

decodeblock/api-utility

最新稳定版本:v1.0.0

Composer 安装命令:

composer require decodeblock/api-utility

包简介

Helper functions for api development with laravel

README 文档

README

License Latest Version on Packagist Tests Status Code Style Status Total Downloads Contributors PHP Version Support

A Laravel package providing helper functions for streamlined API development. Simplify response handling and enhance the structure of your APIs.

Installation

Install the package via Composer:

composer require decodeblock/api-utility

Usage

Example

Using the ApiResponder trait for handling JSON responses:

use Illuminate\Http\Response;
use Decodeblock\ApiUtility\Traits\ApiResponder;

class YourController extends Controller
{
    use ApiResponder;

    public function index()
    {
        return $this->successResponse("Hello, API Utility", Response::HTTP_OK, null);
    }
}

The ApiResponder trait provides methods like:

  • success($message, $code, $data, $metadata = null): For successful responses.
  • error($message, $code, $data, $metadata = null): For error responses.

Testing

Run tests using:

composer test

Changelog

Detailed changes for each release are documented in the CHANGELOG.

Contributing

We welcome contributions! Please see the CONTRIBUTING guide for details.

Credits

License

This package is licensed under the MIT License.

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固