定制 kriit24/project-rest-server 二次开发

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

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

kriit24/project-rest-server

最新稳定版本:v1.2.8

Composer 安装命令:

composer require kriit24/project-rest-server

包简介

Laravel REST API server what based on database models and routing, no controller or other coding is needed

README 文档

README

Project Rest Server is REST-api server for mysql
Its based on Laravel 9+ framework

Installation

# download from packagist

composer require kriit24/project-rest-server

# install package

php artisan project-rest-server:install

Client for server

react-native: project-rest-client

EASY TO USE

//API dynamic request
Route::get('/fetch/{model_name}/{id?}', function (Request $request, $model, $id = null) {

    $primary_key = app("App\\Models\\" . $model)->getKeyName();    

    $to_request = \Project\RestServer\Http\Requests\ToRequest::Get();
    $to_request->request->add(['where' => array_filter([$primary_key => $id])]);    
    
    $event = new Project\RestServer\Broadcasting\DBBroadcast(
        Project\RestServer\Getter\MysqlGetter::class
    );
    $data = $event->fetch('channel_name', $model, $to_request);
    return response(['status' => 'ok', 'count' => count($data), 'data' => $data]);
});
//https://localhost/fetch/object
//https://localhost/fetch/address
//https://localhost/fetch/client
//...

DOCS

config

relationship

usage

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-21