PHPackages                             dedsec/laravel-autoseeder - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. dedsec/laravel-autoseeder

ActiveLibrary[Testing &amp; Quality](/categories/testing)

dedsec/laravel-autoseeder
=========================

Automatically generate realistic database seeders for Laravel models including relationships.

v1.1.2(8mo ago)010MITPHPPHP &gt;=7.4

Since Aug 28Pushed 8mo agoCompare

[ Source](https://github.com/abdullahiqbal93/laravel-autoseeder)[ Packagist](https://packagist.org/packages/dedsec/laravel-autoseeder)[ Docs](https://github.com/abdullahiqbal93/laravel-autoseeder)[ RSS](/packages/dedsec-laravel-autoseeder/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (5)Used By (0)

Laravel AutoSeeder
==================

[](#laravel-autoseeder)

Automatically generate realistic database seeders for Laravel models, including relationships.

---

Quick start
-----------

[](#quick-start)

1. Install (dev dependency):

```
composer require dedsec/laravel-autoseeder --dev
```

2. (Optional) Publish config:

```
php artisan vendor:publish --provider="Dedsec\\LaravelAutoSeeder\\AutoSeederServiceProvider" --tag=config
```

3. Generate seeders:

```
php artisan make:auto-seeders
```

4. Run seeders:

```
php artisan db:seed
```

---

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

[](#requirements)

- PHP: &gt;= 7.4
- Laravel: &gt;= 8.0
- Supported DB: MySQL, PostgreSQL, SQLite, SQL Server

---

Usage &amp; options
-------------------

[](#usage--options)

Run the generator (common options shown):

```
php artisan make:auto-seeders [--path=app/Models] [--limit=10] [--only=User,Post] [--force] [--quiet] [--verbose]
```

Options (summary):

- `--path` — models directory (default: `app/Models`)
- `--limit` — number of records per model (default: `10`)
- `--only` — comma-separated model class basenames to process (e.g. `User,Post`)
- `--force` — overwrite existing generated seeders
- `--quiet` — suppress output (useful for CI)
- `--verbose` — show debug details

---

Examples
--------

[](#examples)

- Generate seeders for all models (10 records each):

```
php artisan make:auto-seeders
```

- Generate 5 records per model:

```
php artisan make:auto-seeders --limit=5
```

- Generate seeders for specific models (User and Post):

```
php artisan make:auto-seeders --only=User,Post
```

- Use a custom models directory:

```
php artisan make:auto-seeders --path=app/CustomModels
```

- Force overwrite of any previously generated seeders:

```
php artisan make:auto-seeders --force
```

---

Key features
------------

[](#key-features)

- Automatic model discovery (scans `app/Models` or provided path)
- Type-aware data generation (respect column types/lengths, including full enum support)
- Foreign-key aware seeding and ordering
- Relationship detection (belongsTo, hasMany, belongsToMany, morphs, etc.)
- Unique &amp; composite-unique constraint handling
- Polymorphic support and two-phase seeding for circular deps

---

Configuration (defaults)
------------------------

[](#configuration-defaults)

After publishing, edit `config/autoseeder.php`. example defaults:

```
return [
	'models_path' => 'app/Models',
	'records_limit' => 10,
	'skip_tables' => [],
	'date_format' => 'Y-m-d H:i:s',
	'string_max_length' => 255,
	'enable_strict_types' => true,
	'enable_relationship_validation' => true,
	'enable_uniqueness_guards' => true,
];
```

---

Troubleshooting
---------------

[](#troubleshooting)

- "No Eloquent models found" — ensure models are in the path or pass `--path`.
- "Table doesn't exist" — run `php artisan migrate` first.
- Foreign key / unique constraint errors — confirm relationships and migration state.

For verbose debug output use:

```
php artisan make:auto-seeders --verbose
```

---

Best practices
--------------

[](#best-practices)

- Use this package in development and testing only.
- Consider committing generated seeders if they are part of test fixtures.
- Generate related models together to preserve referential integrity.
- Use `--only` and reasonable limits when working with large schemas.

---

License
-------

[](#license)

MIT

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance60

Regular maintenance activity

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

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

Total

4

Last Release

257d ago

### Community

Maintainers

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

---

Top Contributors

[![abdullahiqbal93](https://avatars.githubusercontent.com/u/163277735?v=4)](https://github.com/abdullahiqbal93 "abdullahiqbal93 (20 commits)")

---

Tags

testinglaravelfakerdatabaseseederRelationshipsseedersauto-generate

### Embed Badge

![Health badge](/badges/dedsec-laravel-autoseeder/health.svg)

```
[![Health](https://phpackages.com/badges/dedsec-laravel-autoseeder/health.svg)](https://phpackages.com/packages/dedsec-laravel-autoseeder)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[guidocella/eloquent-populator

Guess attributes for Eloquent model factories

7661.6k2](/packages/guidocella-eloquent-populator)[code-distortion/adapt

A Laravel package that builds databases for your tests, improving their speed.

2835.5k](/packages/code-distortion-adapt)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)[toponepercent/baum

Baum is an implementation of the Nested Set pattern for Eloquent models.

3154.7k](/packages/toponepercent-baum)

PHPackages © 2026

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