Looking to hire Laravel developers? Try LaraJobs

laravel-dump maintained by siteset

Description
Dump database tables with records as JSON for Laravel Framework
Last update
2024/12/31 11:17 (1.0.x-dev)
License
Downloads
50
Tags

Comments
comments powered by Disqus

Dump Database Tables With Records as JSON

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