Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Easy Backups Laravel Package

aaix/laravel-easy-backups

Developer-first Laravel backup package with an interactive CLI wizard, direct Artisan commands for automation, and a fluent API to build custom workflows. Create/restore DB backups, choose destinations, enable compression, and control retention.

View on GitHub
Deep Wiki
Context7

sidebar_position: 40

Common Recipes

This page provides ready-to-use solutions for common backup scenarios.

Daily Backup to Remote Storage with Cleanup

To create a daily automated backup of your main database to a remote location (e.g. S3, configured as backup) and keep only the 7 most recent backups, you can schedule the included Artisan command directly.

In routes/console.php:

use Illuminate\Support\Facades\Schedule;

Schedule::command('easy-backups:db:create --compress --max-remote-backups=7')
    ->daily()
    ->at('02:00');

Note: We omitted --to-disk, so it automatically uses the default remote disk defined in your config.

Alternatively, if you prefer a custom command class using the Facade:

Backup::database('mysql')
    ->saveTo('backup')
    ->compress()
    ->maxRemoteBackups(7)
    ->run();

Backup User Uploads

If you need to back up user-uploaded files (e.g. storage/app/public) alongside your database, dispatch a separate job for the files.

:::info Single Responsibility A backup job handles either a database or files, not both simultaneously. :::

use Aaix\LaravelEasyBackups\Facades\Backup;

// 1. Backup the Database
Backup::database(config('database.default'))
    ->saveTo('backup')
    ->compress()
    ->run();

// 2. Backup the Files
Backup::files()
    ->includeDirectories([
        storage_path('app/public')
    ])
    ->saveTo('backup')
    ->run();

Create Encrypted Backups

For sensitive data, creating an encrypted backup is recommended.

Creating the backup:

use Aaix\LaravelEasyBackups\Facades\Backup;

Backup::database('mysql')
    ->encryptWithPassword(config('app.backup_password'))
    ->saveTo('backup')
    ->run();

Restoring the backup:

To restore an encrypted backup, you must provide the password.

use Aaix\LaravelEasyBackups\Facades\Restorer;

Restorer::database()
    ->fromDisk('backup')
    ->toDatabase('mysql')
    ->latest()
    ->withPassword(config('app.backup_password'))
    ->run();

Email Notifications

To receive alerts when a backup process fails (or succeeds), configure the notification channels.

use Aaix\LaravelEasyBackups\Facades\Backup;

Backup::database('mysql')
    ->saveTo('backup')
    ->compress()
    // Requires your mail driver to be configured
    ->notifyOnFailure('mail', 'monitoring@example.com') 
    ->run();
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui