Laravel 5 database backup using Laravel Backup PackageBy Hardik Savani | March 28, 2016 | | 7352 Viewer | Category : Laravel
Share this post:
In this post, i want to show you how to take database backup using Laravel backup package. this package will provide command to take backup from your live server and that command you can use in crontab file on server, that way you can get backup daily on every hourly etc as you want. Database backup is very important for your projects.
This is a proper example and very simple way to use. in this example you can download mysql database backup using laravel backup package. one more thing this will work if you have php 5.5.9 or higher and Laravel 5.1.20 or higher. so let's start from install "Laravel Backup" package.
composer require spatie/laravel-backup
Now open config/app.php file and add service provider.
'providers' => [
Publish Config File
following command through you can create publish config file for laravel backup package. after fire this command you can see one file app/config/laravel-backup.php and you can change your own setting.
php artisan vendor:publish --provider="Spatie\Backup\BackupServiceProvider"
Ok, now we are ready to take a mysql database or PostgreSQL backup from using bellow command.
php artisan backup:run
At last you can find file storage/app/backupfile in your storage directory. in that folder store all backups date-time wise will save. above command you can add on your server cronbob file.
- How to make simple dependent dropdown using jquery ajax in Laravel 5?
- How to execute mysql query in laravel?
- PHP Laravel 5 - Sub-domain routing file Example
- Laravel 5 create and download zip file example using chumper/zipper composer package
- Bootstrap daterangepicker example code with demo using daterangepicker.js
- Pixel tracking code php example
- Laravel 5.2 - User ACL Roles and Permissions with Middleware using entrust from Scratch Tutorial
- Solve - no connection could be made target machine actively refused it laravel