Download the PHP package therealsmat/laravel-push-db without Composer
On this page you can find all versions of the php package therealsmat/laravel-push-db. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download therealsmat/laravel-push-db
More information about therealsmat/laravel-push-db
Files in therealsmat/laravel-push-db
Package laravel-push-db
Short Description :Laravel package to enable easy database exports
License MIT
Homepage https://github.com/therealsmat/laravel-push-db
Informations about the package laravel-push-db
laravel-push-db
This package allows you to easily export your database. It also provides an artisan command, php artisan db:push
to make the process simpler. You can either run manually from the console or use with Laravel scheduler. It's totally a matter of choice.
Requirements
PHP 5.4+, Composer are required.
Installation
Run composer require therealsmat/laravel-push-db
to pull the latest version of the package
Configuration
To start using laravel-push-db, add therealsmat\PushDB\PushDBServiceProvider::class
to the providers array of your app.php
file.
Next, publish the PushDB Service provider by running php artisan vendor:publish --provider="therealsmat\PushDB\PushDBServiceProvider"
.
You will get a config file named pushdb.php
. Feel free to edit it if you wish.
Also out of the box, you will get a new artisan command db:push
. This command alone will get your database exported quickly.
Usage
There are two ways to use this package.
Controller
Command
Simply run php artisan db:push
and your database will be placed in the path you set from the pushdb.php
output_path
option.
As simple as this command is, it can be used in several ways.
- You can use programmatically in your controllers
Of course, you must have set up your s3 disk from the filesystems.php
file.
- You can schedule (1) above to run automatically using Laravel Scheduler e.g
Supported Databases
Only mysql database is supported for now!
TODO
- Implement push to cloud storage feature e.g push to Dropbox, google drive e.t.c.
- Check that the config values are present before sending into the
process
method. - Check to see that the database exists before exporting.
- Write comprehensive tests to make the package more reliable.
- Include support for other databases.
License
The MIT License (MIT). Please see License File for more information.