siteset / laravel-dump
Dump database tables with records as JSON for Laravel Framework
dev-main
2024-12-31 09:03 UTC
Requires
- php: ^7.2 || ^8.0
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