pavliq / laravel-backup-package
Laravel package for database backup
dev-master
2025-08-20 17:37 UTC
Requires
- php: ^8.2
Requires (Dev)
- orchestra/testbench: ^8.5
This package is auto-updated.
Last update: 2026-02-20 18:42:37 UTC
README
- Installation
composer require pavliq/laravel-backup-package:dev-master
- Create an artisan command
php artisan make:command BackupDatabase
- Open the generated file and add
<?php namespace App\Console\Commands; use Illuminate\Console\Command; use Pavliq\LaravelBackupPackage\Services\DatabaseBackupService; class BackupDatabase extends Command { protected $signature = 'app:backup'; public function handle(DatabaseBackupService $service) { $service->backupDatabase(); } }
- Run the command
php artisan app:backup
- Optional: Limit the number of backups
You can set a MAX_BACKUPS variable in your .env file to limit the number of stored backup files.
By default, it keeps 5 backups:
MAX_BACKUPS=5
Database backups will be created in storage/app/backups/db