PHPackages                             pittacusw/database - 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. pittacusw/database

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

pittacusw/database
==================

Generate Laravel seeders from existing MySQL tables and backup or restore database tables

v4.0(2mo ago)0303PHPPHP ^8.0.2

Since Sep 12Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/PittacusW/database)[ Packagist](https://packagist.org/packages/pittacusw/database)[ RSS](/packages/pittacusw-database/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (6)Versions (9)Used By (0)

pittacusw/database
==================

[](#pittacuswdatabase)

`pittacusw/database` is a Laravel package for:

- generating seeders from existing table data
- exporting each MySQL table to a gzipped SQL dump
- restoring SQL dump files back into a MySQL database

The package is intended for Laravel applications and targets Laravel `9.x` through `13.x`.

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

[](#requirements)

- PHP `^8.0.2`
- Laravel `^9.26|^10.0|^11.0|^12.0|^13.0`
- MySQL client binaries available on the host machine for `db:backup` and `db:restore`
    - `mysqldump`
    - `mysql`

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

[](#installation)

```
composer require pittacusw/database
```

Laravel package discovery will register the service provider and the `Iseed` facade automatically.

Commands
--------

[](#commands)

### `php artisan iseed`

[](#php-artisan-iseed)

Generate seeders from one or more tables.

```
php artisan iseed users
php artisan iseed users,posts --force
php artisan iseed users --exclude=password,remember_token --orderby=id --direction=DESC
php artisan iseed audit_logs --max=1000 --chunksize=250 --dumpauto=0
```

Important options:

- `--force`: overwrite existing seed files without confirmation
- `--clean`: clear the managed `#iseed` section inside `database/seeders/DatabaseSeeder.php`
- `--database=`: choose a Laravel database connection
- `--max=`: limit exported rows
- `--chunksize=`: split inserts into smaller batches
- `--exclude=`: omit comma-separated columns
- `--noindex`: remove numeric indexes from exported arrays
- `--classnameprefix=` and `--classnamesuffix=`: customize the generated seeder class name

Generated files are written to `database/seeders`.

### `php artisan db:iseed`

[](#php-artisan-dbiseed)

Generate seeders for all tables except a small built-in ignore list:

- `migrations`
- `password_resets`
- `failed_jobs`
- `github_webhook_calls`
- `jobs`

Examples:

```
php artisan db:iseed
php artisan db:iseed users
php artisan db:iseed --database=legacy --chunksize=100
```

### `php artisan db:backup`

[](#php-artisan-dbbackup)

Create a gzipped SQL dump per table in `database/sql` by default.

```
php artisan db:backup
php artisan db:backup --database=legacy --path=storage/backups/sql
php artisan db:backup --mysqldump-binary="C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqldump.exe"
```

Notes:

- this command is MySQL-only
- dumps are executed through `mysqldump` using Symfony Process, not through a shell string
- output files are created as `*.sql.gz`
- one file is generated per table
- dump output is streamed directly into gzip files, so large tables are not buffered fully in PHP memory
- the database password is passed through `MYSQL_PWD` instead of a `--password=` CLI argument
- the command uses `--single-transaction`, `--quick`, `--skip-lock-tables`, and `--hex-blob`
- `--gzip-level=` accepts values from `0` to `9` and defaults to `6`

### `php artisan db:restore`

[](#php-artisan-dbrestore)

Restore `.sql` and `.sql.gz` files from `database/sql` by default.

```
php artisan db:restore
php artisan db:restore --database=legacy --path=storage/backups/sql
php artisan db:restore --mysql-binary="C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe"
```

Notes:

- this command is MySQL-only
- files are restored in filename order
- SQL input is wrapped with `SET FOREIGN_KEY_CHECKS=0/1` for safer restores
- `.sql` and `.sql.gz` files are streamed into `mysql`, so restore does not fully decompress a backup into memory first
- `--chunk-size=` controls the per-read streaming size and defaults to `1048576` bytes

DatabaseSeeder markers
----------------------

[](#databaseseeder-markers)

If you want `iseed` to manage a dedicated section inside `DatabaseSeeder`, add markers like this:

```
public function run()
{
    #iseed_start
    #iseed_end
}
```

When the markers are present, generated seeders are inserted between them. Otherwise the package appends the seeder call inside `run()`.

Compatibility notes
-------------------

[](#compatibility-notes)

- The package assumes Laravel's standard `database/seeders` path.
- Seeder generation works through Laravel's database connection layer.
- Backup and restore commands require a MySQL connection configured in `config/database.php`.
- On Windows and Linux, the MySQL client binaries only need to be available on `PATH`, or you can pass explicit paths with `--mysqldump-binary` and `--mysql-binary`.

Testing
-------

[](#testing)

```
vendor/bin/phpunit
```

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance89

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~235 days

Recently: every ~328 days

Total

8

Last Release

62d ago

Major Versions

v1.1.2 → v3.12026-02-03

v3.1 → v4.02026-03-18

PHP version history (4 changes)v1.0PHP ^7.2|^8.0

v1.1.2PHP ^8.1

v2PHP ^8.2

v4.0PHP ^8.0.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/97c33f4ec07e9426c6c66fe4d0b0840a31823e10992dcd1824bc91982d043ea3?d=identicon)[contal](/maintainers/contal)

---

Top Contributors

[![PittacusW](https://avatars.githubusercontent.com/u/5810290?v=4)](https://github.com/PittacusW "PittacusW (38 commits)")

---

Tags

laraveldatabaseartisanmysqldumpseed

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pittacusw-database/health.svg)

```
[![Health](https://phpackages.com/badges/pittacusw-database/health.svg)](https://phpackages.com/packages/pittacusw-database)
```

###  Alternatives

[nwidart/db-exporter

Export your database quickly and easily as a Laravel Migration and all the data as a Seeder class.

37839.1k](/packages/nwidart-db-exporter)[elimuswift/db-exporter

Export your database quickly and easily as a Laravel Migration and all the data as a Seeder class.

364.7k](/packages/elimuswift-db-exporter)[boaideas/laravel-cli-create-user

An artisan command to create, list and remove users in a laravel application from the cli

1610.7k](/packages/boaideas-laravel-cli-create-user)[maxim-oleinik/blade-migrations-laravel

An intelligent alternative version of Laravel Database Migrations - uses raw-sql syntax, transactions, auto-rollback, UP-DOWN-UP testing

242.3k](/packages/maxim-oleinik-blade-migrations-laravel)

PHPackages © 2026

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