Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ashrafbasry/larabackup
Simple Laravel Database Backup Solution
https://github.com/ashrafbasry/larabackup
backup database laravel mysql mysql-dump mysqldump-php
Last synced: about 1 month ago
JSON representation
Simple Laravel Database Backup Solution
- Host: GitHub
- URL: https://github.com/ashrafbasry/larabackup
- Owner: AshrafBasry
- License: mit
- Created: 2019-06-01T18:49:42.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-05-05T05:15:45.000Z (over 2 years ago)
- Last Synced: 2024-10-10T06:52:03.786Z (about 1 month ago)
- Topics: backup, database, laravel, mysql, mysql-dump, mysqldump-php
- Language: PHP
- Homepage:
- Size: 21.5 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Larabackup
Simple Laravel Database Backup Solution
## Installation
```
composer require basry/larabackup
```
### For Laravel < 5.5
After updating composer, add the ServiceProvider to the providers array in config/app.php
````
Basry\Larabackup\LarabackupServiceProvider::class,
````## Usage
Using Facade
```
use Basry\Larabackup\Facades\Larabackup;
```
#### Backup
```
Larabackup::backup(); // Auto Naming
```
Or
```
Larabackup::backup($dumpName);
```#### Restore
```
Larabackup::restore($dumpFullName);
```### Artisan
You can backup, restore, and list database dumps using cli.
#### Backup
```
php artisan larabackup:backup
```
#### Restore
```
php artisan larabackup:restore dumpFullName
```
#### List Dumps
```
php artisan larabackup:list
```
## Config
You can publish config files if you need to change the defaults
```
php artisan vendor:publish --tag=larabackup-config
```
### Default Configuration
```
'disk' => 'local', // Storage Disk To use
'path' => 'database/dumps', // Path To save and restore dumps
```
### Override Default Configuration
You can override any of the default configs
#### Database Connection
```
Larabackup::connection($connection)->backup();
```
```
php artisan larabackup:backup --database=DatabaseConnection
```
#### Storage Disk
```
Larabackup::disk($disk)->restore($backupName);
```
```
php artisan larabackup:backup --disk=Disk
```
#### Storage Path
```
Larabackup::path($path)->backup();
```
```
php artisan larabackup:backup --path=Path
```
## LicenseLarabackup is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).