承接 noweh/eloquent-dual-database 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

noweh/eloquent-dual-database

Composer 安装命令:

composer require noweh/eloquent-dual-database

包简介

Custom Eloquent Builder for dual database.

README 文档

README

Laravel MIT Licensed

This package provides a trait that override the Eloquent Builder in order to improve the management of Dual DB, with one DB for Read and Another for Write.

Indeed, this plugin allows you to retrieve freshly inserted data, even if the have not yet been duplicated on the Read Database.

Installation

First you need to add the component to your composer.json

composer require noweh/laravel-plugin-dual-database

Update your packages with composer update or install with composer install.

Simple Usage

Use the trait Noweh\EloquentDualDatabase\EloquentDualDatabaseTrait in your Model.

Example

use Noweh\EloquentDualDatabase\EloquentDualDatabaseTrait;

class MyModel extends Model
{
    use EloquentDualDatabaseTrait;
    
    ...
}

Or, for a custom usage

Override the Eloquent Method newEloquentBuilder($query) in your Model.

Example

use Noweh\EloquentDualDatabase\CustomEloquentBuilder;

class MyModel extends Model
{
    public function newEloquentBuilder($query): Builder
    {
        ...
        return new CustomEloquentBuilder($query);
    }
    
    ...
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-12-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固