承接 ventrec/laravel-entity-sync 相关项目开发

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

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

ventrec/laravel-entity-sync

Composer 安装命令:

composer require ventrec/laravel-entity-sync

包简介

Syncs entities from one project to another

README 文档

README

Latest Version on Packagist Software License Build Status Total Downloads

Easily sync entities, when changes occur, to another project.

Introduction

This package is designed to sync entities from one laravel project to another, something that can be useful if you have a master and client setup.

For this to work, you will need to install the client package in the laravel project that you wish to sync your entities to.

Installation

  1. composer require ventrec/laravel-entity-sync
  2. Add Ventrec\LaravelEntitySync\LaravelEntitySyncProvider::class to providers in app.php
  3. Publish the config file php artisan vendor:publish --provider="Ventrec\LaravelEntitySync\LaravelEntitySyncProvider"
  4. Update the config file
    • Add the entities that you would like to monitor for changes to the config file.
    • Enter the full url to the endpoint where the requests should go.
    • Enter an api token that should be used to verify the requests

Usage

In some cases you might have attributes on a model that you do not want to sync. For this you can define a method named ignoreSyncAttributes that returns an array containing the name of attributes you do not want to sync.

Example

In a User model you might want to exclude the password:

public function ignoreSyncAttributes()
{
    return ['password'];
}

Prevent observer from running while seeding

In order to prevent the observer from running while seeding, you have to disable the package in runtime.

In your DatabaseSeeder class, add the following line at the top of the run() method:

config(['laravelEntitySync.enabled' => false]);

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固