Friday, November 21, 2025
HomeLanguagesLaravel Automatic Database Backup Daily, Weekly, Monthly

Laravel Automatic Database Backup Daily, Weekly, Monthly

In this laravel database backup tutorial, you will learn how to backup of database in laravel apps.

This tutorial will help you step by step to take database backup daily, hourly, weekly, and monthly in laravel apps using the database package.

Laravel Automatic Database Backup Daily, Weekly, Monthly

Follow the below step and take database backup in laravel apps:

Step 1: Install Package

First of all, use the following command to install laravel database package:

cd /project directory

Then

composer require spatie/laravel-backup

Step 2: Add ServiceProvider

Next step, Navigate to config/app.php file. And then add service provider as follow:

'providers' => [	....	Spatie\Backup\BackupServiceProvider::class,]

Step 3: Publish Vendor Of Package

After that, run the following command to publish vendor folder of installed package:

php artisan vendor:publish --provider="Spatie\Backup\BackupServiceProvider"

Note that, Navigate to app/config/laravel-backup.php, and change configuration details.

Step 4: Backup With Command

Run the following command to download database backup into storage/app/backupfile:

php artisan backup:run

So Navigate to storage/app/backupfile in your storage directory. And find all backups files here.

RELATED ARTICLES

Most Popular

Dominic
32405 POSTS0 COMMENTS
Milvus
97 POSTS0 COMMENTS
Nango Kala
6781 POSTS0 COMMENTS
Nicole Veronica
11928 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11997 POSTS0 COMMENTS
Shaida Kate Naidoo
6907 POSTS0 COMMENTS
Ted Musemwa
7166 POSTS0 COMMENTS
Thapelo Manthata
6862 POSTS0 COMMENTS
Umr Jansen
6847 POSTS0 COMMENTS