承接 hydrat-agency/laravel-db-dumper 相关项目开发

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

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

hydrat-agency/laravel-db-dumper

最新稳定版本:v1.1.0

Composer 安装命令:

composer require hydrat-agency/laravel-db-dumper

包简介

Brings db:export/db:import command to laravel for easier environment propagation

README 文档

README

Brings db:export and db:import artisan commands to Laravel, to easily copy database to another environment.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Ever worked with Wordpress and used the WP-Cli ? How handful are wp db:export and wp db:import commands... 😻

This package brings the same functionality to Laravel. You can...

  • ... export database to a SQL file :
❯ php artisan db:export /path/to/file.sql

Exporting database to /path/to/file.sql
Database exported successfully.
  • ... import database from an SQL file :
❯ php artisan db:import /path/to/file.sql

Importing database from /path/to/file.sql
Database imported successfully.

This package uses spatie/db-dumper in the background to generate db exports.

Installation

This package requires php >= 8.1 and laravel >= 8.0.

You can install the package via composer:

composer require hydrat-agency/laravel-db-dumper

Usage

Supported databases

Database Export Import
MySQL
MariaDB 🅾️
PostgreSQL 🅾️ 🅾️
SQLite 🅾️
SQL Server 🅾️ 🅾️

Using Db Dumper from artisan CLI

  • Exporting to a file :
php artisan db:export /path/to/file.sql  # full path
php artisan db:export ../dump.sql        # relative path

ℹ If you don't provide a filename in your path, a name will be automatically generated :

❯ php artisan db:export

Exporting database to /path/to/project/dbname_2022-10-05_09-59-48.sql
Database exported successfully.
  • Importing from a file :
php artisan db:import /path/to/file.sql  # full path
php artisan db:import ../dump.sql        # relative path

Using Db Dumper from your code

# Using instance
$dumper = new Hydrat\LaravelDbDumper\LaravelDbDumper();
$dumper->dumpTo('path/to/file.sql', 'dbname');
$dumper->importFrom('path/to/file.sql');

# Using facade
use Hydrat\LaravelDbDumper\Facades\LaravelDbDumper;

LaravelDbDumper::dumpTo('path/to/file.sql', 'dbname');
LaravelDbDumper::importFrom('path/to/file.sql');

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Feel free to contribute !

Security Vulnerabilities

If you find any security vulnerabilities, please don't report it publicly.
Instead, contact me by private message or at thomas@hydrat.agency.

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固