定制 alxarafe/resource-eloquent 二次开发

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

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

alxarafe/resource-eloquent

最新稳定版本:0.1.2

Composer 安装命令:

composer require alxarafe/resource-eloquent

包简介

Eloquent ORM adapter for alxarafe/resource-controller. Implements RepositoryContract, QueryContract, and TransactionContract using Illuminate Database.

README 文档

README

PHP Version CI Tests Static Analysis PRs Welcome

Eloquent ORM adapter for alxarafe/resource-controller.

Implements RepositoryContract, QueryContract, and TransactionContract using Illuminate Database.

Ecosystem

Package Purpose Status
resource-controller Core CRUD engine + UI components ✅ Stable
resource-eloquent Eloquent ORM adapter ✅ Stable
resource-blade Blade template renderer adapter ✅ Stable
resource-twig Twig template renderer adapter ✅ Stable

Installation

composer require alxarafe/resource-eloquent

This will automatically install alxarafe/resource-controller and illuminate/database.

Usage

use Alxarafe\ResourceController\AbstractResourceController;
use Alxarafe\ResourceController\Contracts\RepositoryContract;
use Alxarafe\ResourceController\Contracts\TransactionContract;
use Alxarafe\ResourceEloquent\EloquentRepository;
use Alxarafe\ResourceEloquent\EloquentTransaction;
use App\Models\Product; // Your Eloquent model

class ProductController extends AbstractResourceController
{
    // ... basic controller configuration ...

    protected function getRepository(string $tabId = 'default'): RepositoryContract
    {
        return new EloquentRepository(Product::class);
    }

    protected function getTransaction(): TransactionContract
    {
        // Get the DB connection from Laravel or Capsule
        return new EloquentTransaction(\Illuminate\Support\Facades\DB::connection());
    }
}

Features

  • Translates declarative field filtering and querying to Eloquent queries.
  • Manages pagination automatically.
  • Handles simple and compound database transactions seamlessly.
  • Converts Eloquent metadata directly into Resource Controller configurations.

Development

Docker

docker compose up -d
docker exec alxarafe-resources composer install

Running the CI pipeline locally

bash bin/ci_local.sh

Running tests only

bash bin/run_tests.sh

License

GPL-3.0-or-later

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2026-04-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固