PHPackages                             misakstvanu/laravel-refreshable-databases - 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. misakstvanu/laravel-refreshable-databases

ActiveLibrary

misakstvanu/laravel-refreshable-databases
=========================================

Adds refreshable database connections support to Laravel's migrate:fresh command

v1.0.2(today)03↑2900%MITPHPPHP ^8.1

Since Jul 23Pushed todayCompare

[ Source](https://github.com/misakstvanu/laravel-refreshable-databases)[ Packagist](https://packagist.org/packages/misakstvanu/laravel-refreshable-databases)[ RSS](/packages/misakstvanu-laravel-refreshable-databases/feed)WikiDiscussions master Synced today

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

laravel-refreshable-databases
=============================

[](#laravel-refreshable-databases)

A Laravel package that lets you declare **additional database connections** that should be wiped and re-migrated every time `php artisan migrate:fresh` runs.

---

Requirements
------------

[](#requirements)

PackageVersionPHP^8.1Laravel10, 11, or 12---

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

[](#installation)

```
composer require misakstvanu/laravel-refreshable-databases
```

The service provider is auto-discovered by Laravel — no manual registration is needed.

---

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

[](#configuration)

Add a `refreshable` key to your `config/database.php`:

```
// config/database.php

return [

    // ... your existing connections ...

    /*
    |--------------------------------------------------------------------------
    | Refreshable Connections
    |--------------------------------------------------------------------------
    |
    | List the names of database connections that should also be wiped and
    | re-migrated every time `php artisan migrate:fresh` is executed.
    |
    */
    'refreshable' => [
        'secondary',
        'reporting',
    ],

];
```

> **Note:** The package automatically merges a default `refreshable: []` into the `database` config, so you only need to add the key when you want to specify connections.

---

Usage
-----

[](#usage)

Simply run the standard Artisan command:

```
php artisan migrate:fresh
```

In addition to refreshing the default (or `--database`-specified) connection, the command will also:

1. Wipe all tables for every connection listed in `database.refreshable`.
2. Run all migrations for each of those connections.

All options accepted by the built-in `migrate:fresh` command — `--seed`, `--seeder`, `--drop-views`, `--drop-types`, `--path`, `--realpath`, `--schema-path`, `--step`, `--force` — are forwarded to each refreshable connection automatically.

---

How It Works
------------

[](#how-it-works)

The package registers a custom `FreshCommand` (with the same `migrate:fresh`signature) that extends Laravel's built-in command. After the standard fresh- migration cycle completes, it iterates over `config('database.refreshable')` and runs `db:wipe` followed by `migrate` for each listed connection.

Because Laravel loads package service providers after the core providers, the package's command registration cleanly replaces the built-in `migrate:fresh`command with no extra configuration needed.

---

Testing
-------

[](#testing)

```
composer test
```

---

License
-------

[](#license)

MIT

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance100

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.6% 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 ~0 days

Total

3

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6bc48954dcd166e31a15e1a5da3e253b5ae1b4ba0031e391de4ccfdecef04c91?d=identicon)[misakstvanu](/maintainers/misakstvanu)

---

Top Contributors

[![misakstvanu](https://avatars.githubusercontent.com/u/42741294?v=4)](https://github.com/misakstvanu "misakstvanu (5 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/misakstvanu-laravel-refreshable-databases/health.svg)

```
[![Health](https://phpackages.com/badges/misakstvanu-laravel-refreshable-databases/health.svg)](https://phpackages.com/packages/misakstvanu-laravel-refreshable-databases)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M245](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

21332.6M1.7k](/packages/illuminate-queue)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k96.5k1](/packages/mike-bronner-laravel-model-caching)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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