PHPackages                             dragon-code/laravel-data-dumper - 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. dragon-code/laravel-data-dumper

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

dragon-code/laravel-data-dumper
===============================

Adding data from certain tables when executing the `php artisan schema:dump` console command

1.6.0(2mo ago)3420.8k↓53.8%1MITPHPPHP ^8.2CI passing

Since Mar 15Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/TheDragonCode/laravel-data-dumper)[ Packagist](https://packagist.org/packages/dragon-code/laravel-data-dumper)[ Fund](https://boosty.to/dragon-code)[ Fund](https://yoomoney.ru/to/410012608840929)[ RSS](/packages/dragon-code-laravel-data-dumper/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (16)Versions (13)Used By (0)

Database Data Dumper for Laravel
================================

[](#database-data-dumper-for-laravel)

  ![Laravel Data Dumper](https://camo.githubusercontent.com/d9aab384a1091bf33f2ebd7898c4e0de4da2a5bb9bd78bfc71b427576be061d2/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c2532304461746125323044756d7065722e706e673f7061747465726e3d746f706f677261706879267374796c653d7374796c655f3226666f6e7453697a653d3130307078266d643d312673686f7757617465726d61726b3d31267468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d647261676f6e2d636f64652532466c61726176656c2d646174612d64756d706572266465736372697074696f6e3d416464696e672b646174612b66726f6d2b6365727461696e2b7461626c65732b7768656e2b657865637574696e672b7468652b2536307068702b6172746973616e2b736368656d6125334164756d702536302b636f6e736f6c652b636f6d6d616e6426696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)[![Stable Version](https://camo.githubusercontent.com/c66d75c63b9bf674c0600a4c7c27463af8d70747037f21163b65aa1db43d8941/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f546865447261676f6e436f64652f6c61726176656c2d646174612d64756d7065723f6c6162656c3d737461626c65267374796c653d666c61742d737175617265)](https://packagist.org/packages/dragon-code/laravel-data-dumper)[![Total Downloads](https://camo.githubusercontent.com/4dd2fe9fd2b1ed973268779b1ce37edea7ae1f0eb9946b5c37e1cf9db0c53a85/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f647261676f6e2d636f64652f6c61726176656c2d646174612d64756d7065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dragon-code/laravel-data-dumper)[![Github Workflow Status](https://camo.githubusercontent.com/08cc14bd8ed5eceda2be54d049c0d43ddc04d2fd51d358b734ef2e237d718453/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f546865447261676f6e436f64652f6c61726176656c2d646174612d64756d7065722f74657374732e796d6c3f7374796c653d666c61742d737175617265)](https://github.com/TheDragonCode/laravel-data-dumper/actions)[![License](https://camo.githubusercontent.com/d3f520612abd55a4545ce3e195e1ea7a96e08e9c8a0b44d16e3a1a3e1d2ebc5f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f647261676f6e2d636f64652f6c61726176656c2d646174612d64756d7065722e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Introduction
------------

[](#introduction)

The [squashing migrations](https://laravel.com/docs/migrations#squashing-migrations) in Laravel does not export data from tables?

There is a solution!

### How it works?

[](#how-it-works)

After installing and configuring the package, you simply run the console command `php artisan schema:dump` (with or without flags - it's up to you), and the final SQL dump file will contain the data structure including the contents of the tables you specified at the configuration stage.

This will allow you to painlessly execute the `php artisan schema:dump --prune` command, which will remove unnecessary migration files.

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

[](#requirements)

- Laravel 10, 11, 12, 13
- PHP 8.2 or higher
- Databases:
    - Sqlite 3
    - MySQL 5.7, 8, 9
    - PostgreSQL 12, 13, 14, 15, 16, 17, 18

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

[](#installation)

To get the latest version of `Database Data Dumper`, simply require the project using [Composer](https://getcomposer.org):

```
composer require dragon-code/laravel-data-dumper
```

Or manually update `require` block of `composer.json` and run `composer update`.

```
{
    "require": {
        "dragon-code/laravel-data-dumper": "^1.0"
    }
}
```

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

[](#configuration)

Since Laravel mechanism for publishing configuration files does not allow them to be merged on the fly, a new array element must be added to the [`config/database.php`](config/settings.php) file:

```
return [
    /*
    |--------------------------------------------------------------------------
    | Schema Settings
    |--------------------------------------------------------------------------
    |
    | This block will contain the names of the tables for which it is
    | necessary to export data along with the table schema.
    |
    */

    'schema' => [
        'tables' => [
            // 'foo',
            // 'bar',
            // App\Models\Article::class,

            // 'qwerty1' => ['column_name_1', 'database/foo'],
            // 'qwerty2' => ['column_name_2', __DIR__ . '/../bar'],
        ],
    ],
];
```

After that, add to the array the names of the tables for which you want to export data.

That's it. Now you can run the [`php artisan schema:dump`](https://laravel.com/docs/migrations#squashing-migrations)console command and enjoy the result.

Note

If you need to delete files from a folder to which a table is related (for example, the `migrations` table), you can specify an array of two values in the parameter, where the first element should be the name of the column containing the file name, and the second element should be absolute or relative folder path.

Warning

Laravel 11.35.2 and below does not know how to report the presence of the `--prune` parameter when calling the `artisan schema:dump` console command, so specifying paths to folders will always delete files from them.

Starting with Laravel version 11.36, files will be deleted only when calling the console command with the `--prune` parameter.

License
-------

[](#license)

This package is licensed under the [MIT License](LICENSE).

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance84

Actively maintained with recent releases

Popularity37

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 91.9% 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 ~73 days

Recently: every ~114 days

Total

11

Last Release

83d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b77790e612f1c9beed1e1533e36eba4954fbd6da2a5c9f71e845cd0f5465f0ad?d=identicon)[Helldar](/maintainers/Helldar)

---

Top Contributors

[![andrey-helldar](https://avatars.githubusercontent.com/u/10347617?v=4)](https://github.com/andrey-helldar "andrey-helldar (91 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")[![lucapuddu](https://avatars.githubusercontent.com/u/21961770?v=4)](https://github.com/lucapuddu "lucapuddu (1 commits)")

---

Tags

databasedatabase-schemadumpdumperlaravellaravel-frameworklaravel-packageschemalaravelschemamigrationdatabasedumpmigrationsdumperdragon codeandrey helldarsquash

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/dragon-code-laravel-data-dumper/health.svg)

```
[![Health](https://phpackages.com/badges/dragon-code-laravel-data-dumper/health.svg)](https://phpackages.com/packages/dragon-code-laravel-data-dumper)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.0M84](/packages/mongodb-laravel-mongodb)[dragon-code/laravel-deploy-operations

Performing any actions during the deployment process

242207.7k2](/packages/dragon-code-laravel-deploy-operations)[dragon-code/migrate-db

Easy data transfer from one database to another

15621.8k](/packages/dragon-code-migrate-db)[itpathsolutions/dbstan

Database Standardization and Analysis Tool for Laravel

442.1k](/packages/itpathsolutions-dbstan)[api-platform/laravel

API Platform support for Laravel

59156.3k10](/packages/api-platform-laravel)

PHPackages © 2026

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