PHPackages                             arpanpatoliya/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. arpanpatoliya/db-backup

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

arpanpatoliya/db-backup
=======================

A Laravel package for database backup with Google Drive integration

v1.2.2(1y ago)022MITPHPPHP ^7.4|^8.0

Since May 17Pushed 1y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (4)Versions (6)Used By (0)

Laravel DB Backup with Google Drive Integration
===============================================

[](#laravel-db-backup-with-google-drive-integration)

[![Latest Version](https://camo.githubusercontent.com/67a13ce9006997eefbe6fd08ad2a8217e2e3b1f43b0fbe6a6f68c3503b2b0523/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617270616e7061746f6c6979612f64622d6261636b75702e737667)](https://packagist.org/packages/arpanpatoliya/db-backup)[![License](https://camo.githubusercontent.com/5e94a8e9ab0defc3aecc7f835e69cd718976847edd0754b38a5b80a4ad5da4b3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f617270616e7061746f6c6979612f64622d6261636b7570)](https://github.com/arpanpatoliya/db-backup/blob/main/LICENSE)

A Laravel package to automate your database backups and upload them directly to **Google Drive**.

---

✨ Features
----------

[](#-features)

- Easily back up your Laravel application's database
- Automatically upload backups to **Google Drive**
- Run backups via artisan commands
- Configure automatic cleanup of old backups

---

📦 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require arpanpatoliya/db-backup
```

⚙️ Configuration
----------------

[](#️-configuration)

 After installation, publish the configuration file:

```
php artisan vendor:publish --provider="Arpanpatoliya\DBBackup\DBBackupServiceProvider"
```

This will create a config file at:

```
config/dbbackup.php

```

Update your .env file with the following values:

```
# Local backup path (customize if needed)
DBBACKUP_LOCAL_PATH=/full/custom/path/if/needed

# Optional: Maximum number of backups to retain (default: 5)
DBBACKUP_MAX_STORED=5

# Database connection (should match config/database.php)
DB_CONNECTION=mysql

# Google Drive API credentials
GOOGLE_DRIVE_CLIENT_ID=your-client-id
GOOGLE_DRIVE_CLIENT_SECRET=your-client-secret
GOOGLE_DRIVE_ACCESS_TOKEN=your-access-token
GOOGLE_DRIVE_REFRESH_TOKEN=your-refresh-token

# Google Drive folder ID to store backups
GOOGLE_DRIVE_FOLDER=your-google-drive-folder-id
```

🚀 Usage
-------

[](#-usage)

### Run Backup Programmatically

[](#run-backup-programmatically)

You can trigger a backup directly in your code:

```
use Arpanpatoliya\DbBackup\Backup;

public function triggerBackupDirectly()
{
    $backup = new Backup();
    $success = $backup->run();

    $success = json_decode($success, true);
    return response()->json($success);
}

```

### Run Backup via Artisan Command

[](#run-backup-via-artisan-command)

Useful for cron jobs or scheduled tasks:

```
php artisan db-backup:run

```

✅ Testing
---------

[](#-testing)

To run the tests:

```
composer test
```

👨‍💻 Credits
-----------

[](#‍-credits)

- [Arpan Patoliya](https://github.com/arpanpatoliya) - Project creator and maintainer

📄 License
---------

[](#-license)

MIT License. See [LICENSE](https://github.com/arpanpatoliya/db-backup/blob/main/LICENSE) for details.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance48

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

Every ~8 days

Total

5

Last Release

380d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fa37a9ada7d99fe42d310d4ceee01849d6e7da3540c41d805fe9f787ebaca22a?d=identicon)[info.arpan](/maintainers/info.arpan)

---

Top Contributors

[![arpanpatoliya](https://avatars.githubusercontent.com/u/104765852?v=4)](https://github.com/arpanpatoliya "arpanpatoliya (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[illuminate/database

The Illuminate Database package.

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

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k20](/packages/fleetbase-core-api)[lemaur/eloquent-publishing

218.1k1](/packages/lemaur-eloquent-publishing)

PHPackages © 2026

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