PHPackages                             sukhrobnurali/laravel-db-backup - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. sukhrobnurali/laravel-db-backup

ActiveLibrary[Database &amp; ORM](/categories/database)

sukhrobnurali/laravel-db-backup
===============================

A Laravel package for backing up MySQL and PostgreSQL databases with support for multiple storage drivers and scheduled backups.

v1.0.0(2y ago)225MITPHPPHP &gt;=8.1

Since Jun 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/sukhrobnurali/laravel-db-backup)[ Packagist](https://packagist.org/packages/sukhrobnurali/laravel-db-backup)[ RSS](/packages/sukhrobnurali-laravel-db-backup/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (2)Used By (0)

Laravel Database Backup
=======================

[](#laravel-database-backup)

**Laravel Database Backup** is a robust, extensible package for Laravel that simplifies backing up your MySQL and PostgreSQL databases. Built with clean, object-oriented principles, this package offers scheduled backups, multi-storage support, and automatic cleanup of old backups.

Features
--------

[](#features)

- **Scheduled Backups:** Easily schedule backups daily, weekly, or monthly using Laravel's scheduler.
- **Multi-Storage Support:** Store backups locally—with the option to add remote storage drivers (e.g., S3, Google Drive) in the future.
- **Automatic Cleanup:** Automatically delete backups older than a specified retention period to save disk space.
- **Artisan Command:** Trigger backups manually using a simple Artisan command.
- **Custom Exception Handling:** Domain-specific error handling with custom exceptions.
- **Extensible Architecture:** Clean, modular design for easy integration and future enhancements.

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require sukhrobnurali/laravel-db-backup
```

Publish the configuration file:

```
php artisan vendor:publish --tag=config --provider="LaravelDbBackup\Providers\DatabaseBackupServiceProvider"
```

Configuration
-------------

[](#configuration)

The configuration file (`config/backup.php`) allows you to customize several aspects of the package:

- **Local Storage:** Specify the directory where backups will be stored.
- **Remote Storage (Stub):** Configure remote storage options for future expansion.
- **Retention Policy:** Set the number of days to retain backups.
- **Scheduling:** Use cron expressions to schedule your backups.
- **Notifications (Stub):** Configure notification options (e.g., via Telegram) for backup events.

Usage
-----

[](#usage)

To manually run a backup, simply execute the Artisan command:

```
php artisan backup:run
```

To schedule automatic backups, add the command to your Laravel scheduler in `app/Console/Kernel.php`:

```
protected function schedule(Schedule $schedule)
{
    $schedule->command('backup:run')->daily();
}
```

Testing
-------

[](#testing)

This package includes a comprehensive test suite using [Orchestra Testbench](https://github.com/orchestral/testbench). To run the tests, execute:

```
vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Contributions are welcome! To contribute:

1. Fork the repository.
2. Create a new branch for your feature or bug fix.
3. Write tests and ensure that everything passes.
4. Submit a pull request.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

752d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/59318027?v=4)[Sukhrob Nurali](/maintainers/sukhrobnurali)[@sukhrobnurali](https://github.com/sukhrobnurali)

---

Top Contributors

[![sukhrobnurali](https://avatars.githubusercontent.com/u/59318027?v=4)](https://github.com/sukhrobnurali "sukhrobnurali (9 commits)")

---

Tags

laraveldatabasebackupmysqlpostgresqlartisanscheduled

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sukhrobnurali-laravel-db-backup/health.svg)

```
[![Health](https://phpackages.com/badges/sukhrobnurali-laravel-db-backup/health.svg)](https://phpackages.com/packages/sukhrobnurali-laravel-db-backup)
```

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M306](/packages/laravel-horizon)[illuminate/database

The Illuminate Database package.

2.8k54.9M11.6k](/packages/illuminate-database)[moharrum/laravel-adminer

Adminer database management tool for your Laravel application.

451.0k](/packages/moharrum-laravel-adminer)[ramadan/easy-model

A Laravel package for enjoyably managing database queries.

111.6k](/packages/ramadan-easy-model)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
