This example repository shows, how to store Laravel backups on local storage, Google Drive, and Dropbox.
- Set up Automatic DB Backup in Laravel
- Store Automatic Laravel Backup On Google Drive
- Store Automatic Laravel Backup On Dropbox
Download or clone this repo
$ git clone https://github.com/qirolab/laravel-backup-example.git
Install all dependency required by Laravel.
$ composer install
Generate app key, configure .env
file and do migration.
# create copy of .env
$ cp .env.example .env
# create Laravel key
$ php artisan key:generate
# run migration
$ php artisan migrate
For Google drive backup, you need to provide these following variables in the .env
file.
GOOGLE_DRIVE_CLIENT_ID=xxx.apps.googleusercontent.com
GOOGLE_DRIVE_CLIENT_SECRET=xxx
GOOGLE_DRIVE_REFRESH_TOKEN=xxx
GOOGLE_DRIVE_FOLDER_ID=null
To get the values for all these environment variables follow the steps mentioned this article:
For Dropbox, add the following variable in the .env
file.
DROPBOX_AUTH_TOKEN=xxx
Follow the steps on this article to get its value:
php artisan backup:run