1. Go to this page and download the library: Download witty/laravel-db-backup library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
return [
// add a backup folder in the app/database/ or your dump folder
'path' => app_path() . '/database/backup/',
// add the path to the restore and backup command of mysql
// this exemple is if your are using MAMP server on a mac
// on windows: 'C:\\...\\mysql\\bin\\'
// on linux: '/usr/bin/'
// trailing slash is
php artisan vendor:publish
sh
$ php artisan db:backup
sh
$ php artisan db:restore dump.sql
sh
$ php artisan db:restore --last-dump
sh
$ php artisan db:restore
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.