PHPackages                             rokde/laravel-clone-database-command - 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. rokde/laravel-clone-database-command

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

rokde/laravel-clone-database-command
====================================

This package adds the ability to clone a database for development purposes locally. So you can overwrite personal data with faker values to keep the data type.

1.0.0(2y ago)04[2 PRs](https://github.com/rokde/laravel-clone-database-command/pulls)MITPHPPHP ^8.2CI passing

Since Feb 6Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/rokde/laravel-clone-database-command)[ Packagist](https://packagist.org/packages/rokde/laravel-clone-database-command)[ Docs](https://github.com/rokde/laravel-clone-database-command)[ Fund](https://paypal.me/rok)[ GitHub Sponsors](https://github.com/rokde)[ RSS](/packages/rokde-laravel-clone-database-command/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (17)Versions (4)Used By (0)

This is the laravel clone database command
==========================================

[](#this-is-the-laravel-clone-database-command)

[![Latest Version on Packagist](https://camo.githubusercontent.com/37859876a7d09374b3f8cf57a3eec5ff493690f930909268ab187e5df522cb7e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726f6b64652f6c61726176656c2d636c6f6e652d64617461626173652d636f6d6d616e642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rokde/laravel-clone-database-command)[![GitHub Tests Action Status](https://camo.githubusercontent.com/dbdab1817ff82c5786ac8b89d5cc2107a540a92413bd8bba228f23143ca4190d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f726f6b64652f6c61726176656c2d636c6f6e652d64617461626173652d636f6d6d616e642f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/rokde/laravel-clone-database-command/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/4133447268d590714789f2cfbc13ea12adebf2b0f8aeafb114efdfbed5c45c69/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f726f6b64652f6c61726176656c2d636c6f6e652d64617461626173652d636f6d6d616e642f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/rokde/laravel-clone-database-command/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/69633126c7acb68a17c9adf4db4af16bbddd044f442771c943efe2590ba71f4d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726f6b64652f6c61726176656c2d636c6f6e652d64617461626173652d636f6d6d616e642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rokde/laravel-clone-database-command)

This artisan command can clone a production database to development databases with overwriting some personal data as configured.

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

[](#installation)

You can install the package via composer:

```
composer require rokde/laravel-clone-database-command
```

Usage
-----

[](#usage)

You can use the pre-configured artisan console command:

```
php artisan db:clone
```

This assumes that there are the entries `source` and `target` in the database configuration.

Otherwise you can create your own clone command to meet the configurable needs.

All single tasks can be found in the `src/Actions` folder. So you can join it like you want if necessary.

### Configuration

[](#configuration)

The whole configuration is stored in a class `DatabaseSyncConfiguration`.

#### source &amp; target connection

[](#source--target-connection)

The name of the connections and the connection configuration is editable. So if you already have a `target` or `source` connection configured - you can change that name if necessary.

#### chunk size

[](#chunk-size)

The chunk size can be configured for a specific table or for any table.

#### limit

[](#limit)

The limit of rows can be configured for a specific table or for any table.

#### mutations

[](#mutations)

A mutation can be configured for a specific table or for any table. So the given column name can be used for any table when existent. So you can replace all `email` columns by a fake email like so:

```
$config->addMutation('email', fn() => fake()->email);
```

#### behaviour

[](#behaviour)

We can decided what to do with the tables already existing on the target: keep it as is, or drop all unhandled tables.

Another option is to delete records before inserting the new ones or should the table be dropped before and the structure should be stored newly.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Robert Kummer](https://github.com/rokde)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance60

Regular maintenance activity

Popularity3

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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

832d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4946056?v=4)[Robert Kummer](/maintainers/rokde)[@rokde](https://github.com/rokde)

---

Top Contributors

[![rokde](https://avatars.githubusercontent.com/u/4946056?v=4)](https://github.com/rokde "rokde (19 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (12 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (7 commits)")

---

Tags

laraveldatabasegdprdsgvo

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/rokde-laravel-clone-database-command/health.svg)

```
[![Health](https://phpackages.com/badges/rokde-laravel-clone-database-command/health.svg)](https://phpackages.com/packages/rokde-laravel-clone-database-command)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[outerweb/settings

Application wide settings stored in your database

4899.2k5](/packages/outerweb-settings)

PHPackages © 2026

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