pavliq/laravel-backup-package

Laravel package for database backup

Maintainers

Package info

github.com/pavliqqq/laravel-backup-package

pkg:composer/pavliq/laravel-backup-package

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-master 2025-08-20 17:37 UTC

This package is auto-updated.

Last update: 2026-02-20 18:42:37 UTC


README

  1. Installation
composer require pavliq/laravel-backup-package:dev-master
  1. Create an artisan command
php artisan make:command BackupDatabase
  1. 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();
    }
}
  1. Run the command
php artisan app:backup
  1. 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