PHPackages                             tyghaykal/laravel-seed-generator - 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. tyghaykal/laravel-seed-generator

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

tyghaykal/laravel-seed-generator
================================

Laravel Seed Generator

v2.3.0(1mo ago)8252.0k↓48.5%61MITPHPPHP &gt;=7.3CI passing

Since May 18Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/tyghaykal/laravel-seeder-generator)[ Packagist](https://packagist.org/packages/tyghaykal/laravel-seed-generator)[ RSS](/packages/tyghaykal-laravel-seed-generator/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (7)Versions (23)Used By (1)

Laravel Seeder Generator
========================

[](#laravel-seeder-generator)

[![Test CI](https://github.com/tyghaykal/laravel-seeder-generator/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/tyghaykal/laravel-seeder-generator/actions/workflows/test.yml/badge.svg?branch=main)[![Latest Stable Version](https://camo.githubusercontent.com/7e3bfb92ba484c05c3fac17f317683698bad37b1a93986475c8179011c3069be/687474703a2f2f706f7365722e707567782e6f72672f7479676861796b616c2f6c61726176656c2d736565642d67656e657261746f722f76)](https://packagist.org/packages/tyghaykal/laravel-seed-generator) [![Total Downloads](https://camo.githubusercontent.com/381a83385ca4eb081f5965d7f2b0af262d04a6fff273aebf10627743939aca71/687474703a2f2f706f7365722e707567782e6f72672f7479676861796b616c2f6c61726176656c2d736565642d67656e657261746f722f646f776e6c6f616473)](https://packagist.org/packages/tyghaykal/laravel-seed-generator) [![Latest Unstable Version](https://camo.githubusercontent.com/2c2db7a21e5262d7b5919a32fd4f28f67990d89a702be25371dee64b8987c461/687474703a2f2f706f7365722e707567782e6f72672f7479676861796b616c2f6c61726176656c2d736565642d67656e657261746f722f762f756e737461626c65)](https://packagist.org/packages/tyghaykal/laravel-seed-generator) [![License](https://camo.githubusercontent.com/cdb1d00f00ad7d06e1354389b558a4e9e2aa38c06f530acfc14b4dcd06df3596/687474703a2f2f706f7365722e707567782e6f72672f7479676861796b616c2f6c61726176656c2d736565642d67656e657261746f722f6c6963656e7365)](https://packagist.org/packages/tyghaykal/laravel-seed-generator)

Generate laravel seeder file from a real data from your database.

Supported Database
------------------

[](#supported-database)

- MariaDB
- MySQL
- PostgreSQL
- SQL Server
- SQLite

Version Compatibility
---------------------

[](#version-compatibility)

LaravelVersion13.x^2.0.\*12.x^2.0.\*11.x^2.0.\*10.x^2.0.\*9.x^2.0.\*8.x^2.0.\*7.x^2.0.\*6.x^2.0.\*5.8.x^2.0.\*5.7.x &amp; beforeNot testedInstall
-------

[](#install)

```
composer require --dev tyghaykal/laravel-seed-generator
```

Laravel Setup
-------------

[](#laravel-setup)

Laravel will automatically register the service provider for you, so no more step on this.

You can generate a config file to personalize this package using `vendor:publish` and choose `TYGHaykal\LaravelSeedGenerator\SeedGeneratorServiceProvider`.

```
php artisan vendor:publish
```

In the config file, you can adjust some of settings on generating seeders file such as namespace, prefix, suffix, and connection.

Usage
-----

[](#usage)

### Options

[](#options)

OptionDescription--show-promptShow menu in prompt--mode=Set the source mode (model or table)--table-modeSet the source mode into table--model-modeSet the source mode into model--models=Generate seed for selected model, can be multiple separated with comma--tables=Generate seed for selected table, can be multiple separated with comma--all-tablesGenerate seed for all tables--where-raw-query=rawQuerySelect data with Raw Query clause--where=field,type,valueSelect data with where clause--where-in=field,value1,value2Select data with where in clause--where-not-in=field,value1,value2Select data with where not in clause--order-by=field,type(asc,desc)Order data to be seeded--limit=intlimit seeded data, value must be integer--all-idsSeed All ids--ids="id1,id2"The ids to be seeded, cannot be used simultaneously with --ignore-ids--ignore-ids="id1,id2"The ids to be ignored, cannot be used simultaneously with --ids--all-fieldsSeed All fields--fields="field1,field2"The fields to be seeded, cannot be used simultaneously with --ignore-fields--ignore-fields="field1,field2"The fields to be ignored, cannot be used simultaneously with --fields--without-relationsSeed All data without relations, only on model mode--relations="relation1,relation2"The relation to be seeded, must be function name of has many relation, only on model mode--relations-limit=intLimit relation data to be seeded, value must be integer, only on model mode--outputThe location of seeder file--no-seedSkip include the database seeder file### Usage on Model with Option

[](#usage-on-model-with-option)

Just set the model value with your model Namespace without `\App\Models` or `\App` or your defined namespace on `config.php`, for example your model namespace is under `\App\Models\Master\Type`, so you just need type `Master\Type`. Can be multiple and separated with comma.

```
php artisan seed:generate --model-mode --models=Master\Type
```

You can run the command and show the menu using

```
php artisan seed:generate --model-mode --models=Master\Type --show-prompt
```

You can filter which data will be included into seeder file using **where** clause

```
php artisan seed:generate --model-mode --models=Master\Type --where=field,type,value
```

You can filter which data will be included into seeder file using **where in** clause

```
php artisan seed:generate --model-mode --models=Master\Type --where-in=field,value1,value2
```

You can filter which data will not be included into seeder file using **where not in** clause

```
php artisan seed:generate --model-mode --models=Master\Type --where-not-in=field,value1,value2
```

You can order the data will be included into seeder file using **order-by** clause

```
php artisan seed:generate --model-mode --models=Master\Type --order-by=field,type
```

You can limit the data will be included into seeder file using **limit** clause

```
php artisan seed:generate --model-mode --models=Master\Type --limit=10
```

You can also define which data you want to include to seeder file based on the id with, can only run with single model only:

```
php artisan seed:generate --model-mode --models=Master\Type --ids="1,2,3"
```

Or you want to skip some ids:

```
php artisan seed:generate --model-mode --models=Master\Type --ignore-ids="1,2,3"
```

You can also define which field that you want include to seeder file based on the field name with:

```
php artisan seed:generate --model-mode --models=Master\Type --fields="id,name"
```

Or you want skip some fields:

```
php artisan seed:generate --model-mode --models=Master\Type --ignore-fields="id,name"
```

You can also define which hasMany relation that you want seed, only has effect on model mode with single model only:

```
php artisan seed:generate --model-mode --models=Master\Type --relations="relationName1,relationName2"
```

You can also limit the relation that you want seed, only has effect on model mode with single model only:

```
php artisan seed:generate --model-mode --models=Master\Type --relations="relationName1,relationName2" --relations-limit=10
```

You can also change the location of generated seeder file:

```
php artisan seed:generate --model-mode --models=Master\Type --output=Should/Be/In/Here/Data

// it will produce in path database/seeders/Should/Be/In/Here/DataSeeder
// or
// it will produce in path database/seeds/Should/Be/In/Here/DataSeeder
```

By default, every generated seeders file will be presented on DatabaseSeeder.php, if you don't want it, you can use **--no-seed** option:

```
php artisan seed:generate --model-mode --models=Master\Type --no-seed
```

### Usage on Table with Option

[](#usage-on-table-with-option)

Just set the tables value as table name, can be multiple separated with comma

```
php artisan seed:generate --table-mode --tables=master_leave_types
```

You can run the command and show the menu using

```
php artisan seed:generate --table-mode --tables=master_leave_types --show-prompt
```

You can filter which data will be included into seeder file using **where** clause

```
php artisan seed:generate --table-mode --tables=master_leave_types --where=field,type,value
```

You can filter which data will be included into seeder file using **where in** clause

```
php artisan seed:generate --table-mode --tables=master_leave_types --where-in=field,value1,value2
```

You can filter which data will not be included into seeder file using **where not in** clause

```
php artisan seed:generate --table-mode --tables=master_leave_types --where-not-in=field,value1,value2
```

You can order the data will be included into seeder file using **order-by** clause

```
php artisan seed:generate --table-mode --tables=master_leave_types --order-by=field,type
```

You can limit the data will be included into seeder file using **limit** clause

```
php artisan seed:generate --table-mode --tables=master_leave_types --limit=10
```

You can also define which data you want to include to seeder file based on the id with:

```
php artisan seed:generate --table-mode --tables=master_leave_types --ids="1,2,3"
```

Or you want to skip some ids:

```
php artisan seed:generate --table-mode --tables=master_leave_types --ignore-ids="1,2,3"
```

You can also define which field that you want include to seeder file based on the field name with:

```
php artisan seed:generate --table-mode --tables=master_leave_types --fields="id,name"
```

Or you want skip some fields:

```
php artisan seed:generate --table-mode --tables=master_leave_types --ignore-fields="id,name"
```

You can also change the location of generated seeder file:

```
php artisan seed:generate --table-mode --tables=master_leave_types --output=Should/Be/In/Here/Data

// it will produce in path database/seeders/Should/Be/In/Here/DataSeeder
// or
// it will produce in path database/seeds/Should/Be/In/Here/DataSeeder
```

By default, every generated seeders file will be presented on DatabaseSeeder.php, if you don't want it, you can use **--no-seed** option:

```
php artisan seed:generate --table-mode --tables=master_leave_types --no-seed
```

###  Health Score

54

—

FairBetter than 96% of packages

Maintenance94

Actively maintained with recent releases

Popularity45

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.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 ~55 days

Recently: every ~105 days

Total

21

Last Release

30d ago

Major Versions

v1.4.3 → v2.0.02024-03-16

### Community

Maintainers

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

---

Top Contributors

[![tyghaykal](https://avatars.githubusercontent.com/u/37505589?v=4)](https://github.com/tyghaykal "tyghaykal (234 commits)")[![ylynfatt](https://avatars.githubusercontent.com/u/19831?v=4)](https://github.com/ylynfatt "ylynfatt (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

---

Tags

generatorlaravelseedseederlaravelgeneratorartisanseedseeders

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tyghaykal-laravel-seed-generator/health.svg)

```
[![Health](https://phpackages.com/badges/tyghaykal-laravel-seed-generator/health.svg)](https://phpackages.com/packages/tyghaykal-laravel-seed-generator)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11223.5M33](/packages/anourvalar-eloquent-serialize)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[mozex/laravel-scout-bulk-actions

Import, flush, and queue-import all your Laravel Scout searchable models at once. Auto-discovers models, runs in bulk, tracks progress.

1539.3k](/packages/mozex-laravel-scout-bulk-actions)

PHPackages © 2026

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