siteset/laravel-dump

Dump database tables with records as JSON for Laravel Framework

dev-main 2024-12-31 09:03 UTC

This package is auto-updated.

Last update: 2025-08-29 02:28:53 UTC


README

Installation

Add the package record to the 'require' section of the composer.json file.

    "require": {
    	...,
        "siteset/laravel-dump": "^1.0@dev"
    },

Update the package with Composer:

composer update siteset/laravel-dump

Setup

Bind command to application kernel /app/Console/Kernel.php

protected $commands = [
    \Siteset\Dump\Console\DumpCommand::class,
];

Add DumpServiceProvider into /config/app.php

'providers' => [
    ...,
    Siteset\Dump\DumpServiceProvider::class,
    ...,
],

Refresh Composer Autoload

composer dump-autoload

Renew or create configuration file (you can delete old file)

php artisan vendor:publish --provider="Siteset\Dump\DumpServiceProvider"

Usage

Execute command db:json to make dump:

php artisan db:json

JSON dump will be created at directory /database/dumps/dump_YYYY-MM-DD_HH-II-SS

You can change it by options --path and --folder