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(11mo ago)012MITPHPPHP &gt;=7.4

Since Aug 28Pushed 11mo 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 1w 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

27

—

LowBetter than 46% of packages

Maintenance50

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 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

354d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/163277735?v=4)[Abdullah Iqbal](/maintainers/abdullahiqbal93)[@abdullahiqbal93](https://github.com/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

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k31.8M162](/packages/laravel-cashier)[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M322](/packages/laravel-ai)[aedart/athenaeum

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

265.2k](/packages/aedart-athenaeum)[forjedio/inertia-table

Backend-driven dynamic tables for Laravel + Inertia.js

272.0k](/packages/forjedio-inertia-table)[calebdw/larastan

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

16132.2k4](/packages/calebdw-larastan)

PHPackages © 2026

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