Generate Laravel test data with one seeder
Writing a Laravel factory and seeder per table by hand rots the moment the schema moves, and copying a production dump into your dev database is a GDPR problem waiting to happen. The fix: foreign-key-consistent, realistic data generated straight from your schema, data that actually looks real, not "Premium Widget 1" and lorem ipsum. One seeder fills the whole database.
Free tier, no card. Want to see the output before wiring anything up? Try the login-free sandbox: paste a schema, generate, look at the rows.
Seed your database with one command
Pull SeedBase in as a dev dependency and run the supplied seeder. It generates and loads foreign-key-consistent data over the Laravel database connection, so your schema has to exist first, which your migrations already own.
php artisan db:seed --class="Seedbase\Laravel\SeedbaseSeeder"
Install it with Composer:
composer require --dev seedbase/seedbase
The supplied SeedbaseSeeder does the work: it generates a realistic, FK-consistent dataset for your schema and writes it through the same Laravel connection your app uses. No per-table seeder, no manual wiring between parents and children.
Realistic data, not "Premium Widget 1"
The point is not just filling rows, it is filling them with data a real query would actually return. SeedBase resolves foreign keys, uses realistic distributions, and writes coherent free text instead of repeating a placeholder, so a customer_id on an order points at a customer that exists and a product name reads like a product, not "Premium Widget 1".
- Foreign keys resolve: every child row points at a parent that exists, so the data loads with constraints on.
- Realistic distributions and coherent free text, not placeholders, so your queries and assertions hit data that looks real.
- One seeder replaces the pile of per-table factories and the wiring between them.
A real alternative to hand-written factories and seeders
A handful of factories is fine. A real schema is not. Once you have dozens of tables, every factory has to know which parent rows exist, which foreign keys to satisfy, and which derived totals to keep in sync. You end up maintaining a second, worse copy of your schema in test code.
- Factories drift: add a NOT NULL column and every factory that misses it starts failing.
- Seeders multiply: one seeder per table, plus all the ordering so children come after their parents.
- Production dumps are a GDPR problem: real names, real emails, real card data sitting in your dev database.
- The data looks fake, so tests pass against rows no real query would ever return.
SeedBase replaces all of that with one seeder that reads your schema, resolves the foreign keys for you, and seeds realistic data in the right order.
Deterministic and reproducible
Generation is seeded. The same seed produces the same data, every run. That keeps CI reproducible: the same seeder run yields the same rows on every machine, so a green build stays green for the right reason. When a test fails, reuse the seed and you reproduce the exact dataset that broke it, instead of chasing a seeder that has since been hand-edited.
Free tier: generate, download, seed
Generation and JSON download are free to use. You do not need push-to-database or any paid feature to seed your Laravel database, because the data loads through your own database connection. Generate once, run the seeder, and let it fill the schema your migrations already own.
Try it
There is a runnable example, so you can clone it, run the seed, and watch a real FK-consistent dataset get written to a database. Then point it at your own schema.
php examples/laravel_seed_demo.php
- Paste a schema and look at the rows in the login-free sandbox, no account needed.
- Drive generation from your editor with the VS Code extension.
- Read the docs for the Laravel seeder and the database connections.
- Create a free account at /register to generate against your own schema.
Stop hand-writing factories and seeders.
Generate a foreign-key-consistent dataset once and seed your Laravel database with one command. Free tier, no card.
Create a free accountMore: login-free sandbox · Django · Symfony · Test data fixtures · VS Code · Docs · home
Frequently asked questions
Is it free?
Yes. Generation and JSON download are part of the free tier, so you can pull a foreign-key-consistent dataset and seed your Laravel database at no cost. Pro adds Parquet export, direct database push and higher row limits, but you do not need any of that to seed a Laravel database from your schema.
How is this different from Laravel factories and seeders?
You do not write factories or seeders per table anymore. SeedBase fills the database foreign-key-consistent out of your schema with realistic data, so an order that points at a customer always finds a customer that exists, and the values look real instead of "Premium Widget 1" or lorem ipsum.
How do I run it?
Run php artisan db:seed with the supplied SeedbaseSeeder class. The command is php artisan db:seed --class="Seedbase\Laravel\SeedbaseSeeder". It generates and loads FK-consistent data over the Laravel database connection, so your schema has to exist first, which your migrations already own.
Is it deterministic?
Yes, per seed. Generation is seeded, so the same seed produces the same data every run. That keeps CI reproducible: the same seeder run yields the same rows, and a failing test can be reproduced exactly by reusing the seed.
Which databases does it support?
It was tested against a real project with 226 tables and works multi-DB across PostgreSQL, MySQL, MariaDB, SQLite and SQL Server, which are the same connections Laravel itself drives.