Download the PHP package dposkachei/laravel-db-snapshots-zip without Composer
On this page you can find all versions of the php package dposkachei/laravel-db-snapshots-zip. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dposkachei/laravel-db-snapshots-zip
More information about dposkachei/laravel-db-snapshots-zip
Files in dposkachei/laravel-db-snapshots-zip
Package laravel-db-snapshots-zip
Short Description Quickly dump and load databases
License MIT
Homepage https://github.com/dposkachei/laravel-db-snapshots-zip
Informations about the package laravel-db-snapshots-zip
Quickly dump and load databases
This package provides Artisan commands to quickly dump and load databases in a Laravel application.
This package supports MySQL, PostgreSQL and SQLite.
Installation
You can install the package via Composer:
In Laravel 5.5 and above, the package will autoregister the service provider. For Laravel 5.4 or below you must install this service provider to config/app.php
:
And finally you should add a disk named snapshots
to app/config/filesystems.php
on which the snapshots will be saved. This would be a typical configuration:
Optionally, you may publish the configuration file with:
This is the content of the published file:
Usage
To create a snapshot (which is just a dump from the database) run:
Giving your snapshot a name is optional. If you don't pass a name the current date time will be used:
When creating snapshots, you can optionally create compressed snapshots. To do this either pass the --compress
option on the command line, or set the db-snapshots.compress
configuration option to true
:
After you've made some changes to the database you can create another snapshot:
To load a previous dump issue this command:
To load a previous dump to another DB connection:
To list all the dumps run:
A dump can be deleted with:
Events
There are several events fired which can be used to perform some logic of your own:
Spatie\DbSnapshots\Events\CreatingSnapshot
: will be fired before a snapshot is createdSpatie\DbSnapshots\Events\CreatedSnapshot
: will be fired after a snapshot has been createdSpatie\DbSnapshots\Events\LoadingSnapshot
: will be fired before a snapshot is loadedSpatie\DbSnapshots\Events\LoadedSnapshot
: will be fired after a snapshot has been loadedSpatie\DbSnapshots\Events\DeletingSnapshot
: will be fired before a snapshot is deletedSpatie\DbSnapshots\Events\DeletedSnapshot
: will be fired after a snapshot has been deleted
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Postcardware
You're free to use this package (it's MIT-licensed), but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.
Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium.
We publish all received postcards on our company website.
Credits
- Freek Van der Herten
- All Contributors
Support us
Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.
Does your business depend on our contributions? Reach out and support us on Patreon. All pledges will be dedicated to allocating workforce on maintenance and new awesome stuff.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-db-snapshots-zip with dependencies
illuminate/support Version ^5.4.30
league/flysystem Version ^1.0.41
spatie/db-dumper Version ^2.11
spatie/laravel-migrate-fresh Version ^1.4.1
spatie/temporary-directory Version ^1.1