Download the PHP package avcodewizard/laravel-backup without Composer
On this page you can find all versions of the php package avcodewizard/laravel-backup. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download avcodewizard/laravel-backup
More information about avcodewizard/laravel-backup
Files in avcodewizard/laravel-backup
Package laravel-backup
Short Description A Laravel package for database and storage backup with auto-cleanup.
License MIT
Informations about the package laravel-backup
๐ฆ Laravel Backup Package
A simple Laravel package to automatically backup your database and storage directory, with a Blade-based UI to view, download, and delete backups.
๐ Features
- ๐ Daily backup of database and storage (
storage/app/public
) - ๐งผ Auto-delete backups older than configurable days (default 5 days)
- ๐งพ List, download, and delete backups via Blade UI
- ๐ค Access control using roles and middleware
- ๐ Configurable via
config/laravelBackup.php
๐ฅ Installation
Install the package via composer:
โ๏ธ Configuration
Edit the config file at: config/laravelBackup.php
- If you want's to backup storage directory
๐ก๏ธ Access Control
To enable UI access control based on user roles:
- Set
'check_access' => true
- Add roles in
'allowed_roles' => ['Admin']
- Ensure your
User
model has ahasRole()
method (e.g., using spatie/laravel-permission)
Middleware used:
Avcodewizard\LaravelBackup\Http\Middleware\CheckLaravelBackupAccess
๐ฅ๏ธ Web Interface
Access the UI at:
Example route setup (already included in the package):
๐ Usage
Create Backup via Web
- Go to
/laravel-backup
- Click Create Backup
- If use want to create backup from ui, make sure to run the queue worker:
Create Backup via Terminal
๐งน Automatic Cleanup
Backups older than keep_days
will be deleted automatically.
Add to Scheduler
In app/Console/Kernel.php
, add:
๐ Backup Storage
Backups are saved in:
Each backup includes:
YYYY-MM-DD-HH-MM-SS_database.sql
YYYY-MM-DD-HH-MM-SS_storage.zip
๐งโ๐ป Developer Notes
Publish Config & Views
This will publish:
config/laravelBackup.php
- Blade views to
resources/views/vendor/laravel-backup/
Middleware Logic
The package uses a configurable middleware to restrict access:
You can customize access logic using roles or your own permission methods.
๐ License
This package is open-sourced software licensed under the MIT license.
ยฉ 2025 Avcodewizard