yadakhov/laradump

A mysqldump wrapper for laravel. Dump your table schemas and data into files.
25,266 25
Install
composer require yadakhov/laradump
Latest Version:v2.3.4
PHP:^7.2|^8.0
Older releases:5 · 6 · 7
License:MIT
Last Updated:Aug 9, 2023
Links: GitHub  ·  Packagist
Maintainer: yadakhov

Laradump

A wrapper package to run mysqldump from laravel console commands.

Installation

Install from packagist

composer require yadakhov/laradump

Add to providers array in config/app.php

    'providers' => [
        // ...others

        Yadakhov\Laradump\LaradumpServiceProvider::class,
    ],

Create configuration file config/laradump.php.

php artisan vendor:publish

Laradump commands

Once the LaradumpServiceProvider is registered, the commands will show up when you do a php artisan.

php artisan
 ...
 laradump
  laradump:drop-tables        Drop tables that do not have backup files.
  laradump:list               List all tables to perform individually.
  laradump:mysqldump          Perform a MySQL dump on every tables.
  laradump:restore            Perform a restore on every tables.
  laradump:save-to-s3         Save laradump folder to s3
  laradump:sync-from-s3       Sync laradump folder from s3
 ...

Doing a mysqldump

php artisan laradump:mysqldump

Will perform a mysqldump of each table in your database and store it in the storage/dumps folder.

Doing a mysql restore

php artisan laradump:restore

Will load all sql files in /storage/dumps.

Perform backup and restore on individual table

php artisan laradump:mysqldump  --table=user
php artisan laradump:restore  --table=user

# To see a list of possible tables
php artisan laradump:list 

Ensure the storage folder is writable.

# Create the tables for storing the files
mkdir storage/laradump/tables
mkdir storage/laradump/data

sudo chmod o+w -R storage

Add ignore the dump files in git

# add line to your .gitignore
/storage/laradump

Related Packages

fisharebest/laravel-floats

Floating point support for Laravel migrations

11,428 11
awssat/laravel-sync-migration

Developer tool helps to sync migrations without refreshing the database

23,794 108
tomzx/laravel-migration

A migration service based on Laravel Database package.

35 5
yadakhov/insert-on-duplicate-key

A trait for MySQL INSERT ON DUPLICATE KEY UPDATE.

3,117,053 275
ucan-lab/laravel-dacapo

Laravel migration support tools

423,246 110

Version History

Version Released PHP Laravel License
v2.3.4 ^7.2|^8.0 MIT
v2.3.3 ^7.2|^8.0 MIT
v2.3.2 ^7.2|^8.0 MIT
v2.3.1 ^7.2|^8.0 MIT
v2.3.0 ^7.2|^8.0 MIT