ldavidsp/laravel-sync 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

ldavidsp/laravel-sync

Composer 安装命令:

composer require ldavidsp/laravel-sync

包简介

Synchronize your local or stage database with the production one.

README 文档

README

Latest Version on Packagist Software License Total Downloads

This package contains some useful Artisan commands to work the synchronization of the local database with the production one.

Requirements

This package requires Laravel 6 or newer.

Installation

You can install the package via Composer:

composer require ldavidsp/laravel-sync

Publish the config file with:

php artisan vendor:publish --tag=sync-config

Add tables to synchronize in config/sync.php:

  /*
    |--------------------------------------------------------------------------
    | Sync tables
    |--------------------------------------------------------------------------
    */
  'sync_tables' => [
    'table_name_1',
  ],

Add the configuration for the production database to config/database.php:

'live-db' => [
  'driver' => env('DB_LIVE_CONNECTION', 'mysql'),
  'host' => env('DB_LIVE_HOST', 'your live server database host here'),
  'port' => env('DB_LIVE_PORT', '3306'),
  'database' => env('DB_LIVE_DATABASE', 'forge'),
  'username' => env('DB_LIVE_USERNAME', 'forge'),
  'password' => env('DB_LIVE_PASSWORD', ''),
],

Add the configuration in .env:

DB_LIVE_CONNECTION=mysql
DB_LIVE_HOST=
DB_LIVE_PORT=3306
DB_LIVE_DATABASE=
DB_LIVE_USERNAME=
DB_LIVE_PASSWORD=

Usage

Synchronize database:

php artisan sync:prod

or

Add the configuration in app/Console/Kernel.php:

/**
  * Sync local database with production.
  */
  if (App::environment('local')) {
    $schedule->command('sync:prod')->everyTenMinutes();
  }

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-11-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固