定制 alighorbani/responder 二次开发

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

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

alighorbani/responder

Composer 安装命令:

composer require alighorbani/responder

包简介

Make a Response to as fast as light!

README 文档

README


🚀 Generate API Response as fast as light!

We solve some problem for You with a package You can call Responder

actually developers make a specific structure for api that developed

✅️ Advantages

  1. You don't need to set pagination logic in your resource because inject automatically
  2. You can make a different response with elegant syntax (use facade)
  3. Automatic Message Mapper on response for example(title => users-list)
  4. Prevent Human mistakes when generate response structure manually
  5. Unlimited Define Structure and used in project
  6. If you decide to Change Your you can do this with little changed

👨‍💻 Usage

In this Example use the resource that contains several items (such as users list)

<?php

use Jenssegers\Mongodb\Eloquent\Model;
use Alighorbani\Responder\ResponderFacade;

class UserController extends Model
{
    public function getUsersList()
    {
        $users = User::all();
        
        return ResponderFacade::resourceResponse($users, 'USERS.LIST', UserResource::class);
    }
}
{
    "success": true,
    "title": "The List of Users Resource",
    "result": [
        {
            "id": 1,
            "name" : "Ali",
            "lastname" : "Ghorbani",
            "birthday" : "2003-01-01"
        },  
        {
            "id": 2,
            "name" : "Mohammad",
            "lastname" : "Karimi",
            "birthday" : "2003-02-18"
        }
    ]
}

TODO

  • Installing With Composer Package & Dependencis
  • how to use the make responder
  • how to use the message config
  • how to use the macroable on this package (to add functionality)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-31