In this tutorial you will learn about the How to Store Backup on Dropbox in Laravel 8 with Spatie and its application with practical example.
In this How to Store Backup on Dropbox in Laravel 8 with Spatie Tutorial, I’ll show you how to take complete laravel application backup on DropBox using spatie laravel backup package. In this tutorial you will learn to store laravel site backup on dropbox using spatie in laravel. In this article I will guide you through process how to take daily automatic backup of your laravel application and store on dropbox using spatie laravel backup package. In this example we will be using spatie/laravel-backup package to take backup of complete laravel application. In this example I will also show you how to integrate DropBox in laravel 8 to store backup on DropBox.
How to Store Backup on Dropbox in Laravel 8 with Spatie
In this step by step tutorial I will demonstrate you how to integrate DropBox in laravel 8 to store backup using spatie. Please follow the instruction given below:
- Step 1: Download Laravel Project
- Step 2: Update Database Credentials
- Step 3: Add Spatie Package in Laravel
- Step 4: Configure Spatie Package
- Step 5: Create Dropbox Token
- Step 6: Set Up Dropbox File System
- Step 7: Insert Dropbox Keys
- Step 8: Store Backup on Dropbox
Install Laravel 8
First of all we need to create a fresh laravel project, download and install Laravel 8 using the below command
1 |
composer create-project --prefer-dist laravel/laravel lara8blog |
Setup Database Credentials
Now, lets create a MySQL database and connect it with laravel application. After creating database we need to set database credential in application’s .env file.
1 2 3 4 5 6 |
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=lara8blog DB_USERNAME=root DB_PASSWORD= |
Install spatie/laravel-backup
In this step run the following command to install spatie/laravel-backup package in laravel 8:
1 |
composer require spatie/laravel-backup |
Configure Spatie Package
Now configure your email id for backup:
1 2 |
MAIL_FROM_ADDRESS=your_email@hotmail.com MAIL_FROM_NAME="${APP_NAME}" |
Now we have to publish the backup.php file using the php artisan vendor command.