A wrapper package to run mysqldump from laravel console commands.

Related tags

Laravel laradump
Overview

Laradump

A wrapper package to run mysqldump from laravel console commands.

Installation

Install from packagist

composer require yadakhov/laradump

Or add to your composer.json

    "require": {
        "yadakhov/laradump": "dev-master"
    },

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:list       List all tables to perform individually.
  laradump:mysqldump  Perform a MySQL dump.
  laradump:restore    Perform a restore.
 ...

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
You might also like...
In-browser console for Laravel PHP framework.
In-browser console for Laravel PHP framework.

Laravel 4 Console In-browser console for Laravel 4 PHP framework. This bundle executes your code within ConsoleController@postExecute context, and dis

๐Ÿ“ Artisan Menu - Use Artisan via an elegant console GUI
๐Ÿ“ Artisan Menu - Use Artisan via an elegant console GUI

๐Ÿ“ Artisan Menu Use Artisan via an elegant console GUI Features Run built-in and custom Artisan commands from a console GUI Prompts to enter required

๐Ÿ“ Artisan Menu - Use Artisan via an elegant console GUI
๐Ÿ“ Artisan Menu - Use Artisan via an elegant console GUI

๐Ÿ“ Artisan Menu Use Artisan via an elegant console GUI Features Run built-in and custom Artisan commands from a console GUI Prompts to enter required

The Missing Laravel Commands

Made with โค๏ธ by SecTheater Foundation Artify CheatSheet will be availble soon Laravel is a great framework and it provides us the ability to create ou

A bookmarkable, searchable cheatsheet for all of Laravel's default Artisan commands.

artisan.page A bookmarkable, searchable cheatsheet for all of Laravel's default Artisan commands. Generation The generation of the manifest files is d

Laravel API architecture builder based on artisan commands.

๐Ÿง‘โ€๐Ÿ”ฌ API-Formula Laravel API architecture builder based on artisan commands. This package provides a nice and fluent way to generate combined control

Execute Laravel Artisan commands via REST APIs and HTTP requests safely.

Artisan Api There might be some times you wanted to execute an Artisan command, but you did not have access to shell or SSH. Here we brought REST API

Run multiple websites using the same Laravel installation while keeping tenant specific data separated for fully independent multi-domain setups, previously github.com/hyn/multi-tenant

The unobtrusive Laravel package that makes your app multi tenant. Serving multiple websites, each with one or more hostnames from the same codebase. B

Run patches migration style in your Laravel applications.
Run patches migration style in your Laravel applications.

This package generates patch files in the same fashion Laravel generates migrations. Each file is timestamped with an up and a down method and is asso

Comments
  • Publishing doesn't seem to work

    Publishing doesn't seem to work

    I'm fairly new to laravel. When trying to publish, as per the instructions, I don't seem to get any options for laradump:

    $ php artisan
    Laravel Framework 7.25.0
    ...
    
    $ composer require yadakhov/laradump
    Using version ^2.1 for yadakhov/laradump
    ./composer.json has been updated
    Running composer update yadakhov/laradump
    Loading composer repositories with package information
    Updating dependencies
    Lock file operations: 1 install, 0 updates, 0 removals
      - Locking yadakhov/laradump (v2.1.0)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 1 install, 0 updates, 0 removals
      - Downloading yadakhov/laradump (v2.1.0)
      - Installing yadakhov/laradump (v2.1.0): Extracting archive
    Generating optimized autoload files
    > Illuminate\Foundation\ComposerScripts::postAutoloadDump
    > @php artisan package:discover
    Discovered Package: fideloper/proxy
    Discovered Package: laravel/ui
    Discovered Package: nesbot/carbon
    Package manifest generated successfully.
    44 packages you are using are looking for funding.
    Use the `composer fund` command to find out more!
    
    $ php artisan vendor:publish
    
     Which provider or tag's files would you like to publish?:
      [0] Publish files from all providers and tags listed below
      [1] Provider: Fideloper\Proxy\TrustedProxyServiceProvider
      [2] Provider: Illuminate\Foundation\Providers\FoundationServiceProvider
      [3] Provider: Illuminate\Mail\MailServiceProvider
      [4] Provider: Illuminate\Notifications\NotificationServiceProvider
      [5] Provider: Illuminate\Pagination\PaginationServiceProvider
      [6] Tag: laravel-errors
      [7] Tag: laravel-mail
      [8] Tag: laravel-notifications
      [9] Tag: laravel-pagination
     >
    

    Perhaps needless to say, artisan isn't aware of laradump commands.

    opened by slefevre 1
  • Problems with passwords

    Problems with passwords

    Hi, thanks for your software. It works great, but I have an issue with the passwords when I generate a table dump, the issue is with special characters, there is a line:

    #ย MySqlDump.php Line: 77 $command = sprintf('mysqldump -u %s -p%s %s -h %s %s --no-create-info --extended-insert --skip-comments > %s', $username, $password, $database, $host, $table, $dataFile);

    I think should be: $command = sprintf('mysqldump -u %s -p'%s' %s -h %s %s --no-create-info --extended-insert --skip-comments > %s', $username, $password, $database, $host, $table, $dataFile);

    Thanks for your patience. Regards.

    opened by granaino 1
Releases(v2.2.0)
Owner
Yada Khov
I'm a developer from Toronto, Canada.
Yada Khov
Laminas\Console is a component to design and implement console applications in PHP.

laminas-console This package is abandoned and will receive no further development! We recommend using laminas/laminas-cli. Laminas\Console is a compon

Laminas Project 10 Nov 27, 2021
Mutex for Laravel Console Commands.

Laravel Console Mutex Mutex for Laravel Console Commands. Laravel Console Mutex 8.x 8.x 7.x 7.x 6.x 6.x 5.8.* 5.8.* 5.7.* 5.7.* 5.6.* 5.6.* 5.5.* 5.5.

Dmitry Ivanov 125 Dec 17, 2022
This Laravel Nova tool lets you run artisan and bash commands directly from Nova 4 or higher.

Laravel Nova tool for running Artisan & Shell commands. This Nova tool lets you run artisan and bash commands directly from nova. This is an extended

Artem Stepanenko 17 Dec 15, 2022
This package provides a console command to convert dynamic JS/CSS to static JS/CSS assets.

Laravel Nova Search This package provides a console command to convert dynamic JS/CSS to static JS/CSS assets. Requirements laravel-mix v6.0+ php 7.3+

Akki Khare 3 Jul 19, 2022
A package for Laravel to perform basic git commands on locally integrated packages.

A package for Laravel to perform basic git commands on locally integrated development packages. If working within multiple local development packages or repositories at once this package is meant to ease the burden of navigating to each individual repository to perform basic git commands.

null 3 Jul 26, 2022
Package for Laravel that gives artisan commands to setup and edit environment files.

Setup and work with .env files in Laravel from the command line NOTE: This doesn't work with Laravel 5 since .env files were changed. This is for Lara

Matt Brunt 6 Dec 17, 2022
A package for more Laravel commands.

Lara-Commands A package for more Laravel commands. Installation This package can be installed via Composer: composer require nimaw/lara-commands --dev

Nima 7 Jan 9, 2022
This package enables you to create and run a fully functioning WebSocket server in your Laravel app.

This package enables you to create and run a fully functioning WebSocket server in your Laravel app. It can optionally receive messages broadcast over ZeroMQ.

Asked.io 181 Oct 6, 2022
A package that makes it easy to have the `artisan make:` commands open the newly created file in your editor of choice.

Open On Make A package that makes it easy to have the artisan make: commands open the newly created file in your editor of choice. Installation compos

Andrew Huggins 94 Nov 22, 2022
This package provides a trait to run your tests against a MinIO S3 server.

Laravel MinIO Testing Tools This package provides a trait to run your tests against a MinIO S3 server. ?? Blog post: https://protone.media/en/blog/how

Protone Media 7 Oct 12, 2022