Seeder and factory

Code that fills the database with starting data (seeder) or realistic fake data for tests (factory).

Also called: db:seed, fake data

Type
Term
Source
General
Language
PHP

Example

The factory created fifty fake leads so I could test the admin list.

In code

php artisan db:seed
php artisan migrate:fresh --seed     # local only: drops all tables
Lead::factory()->count(20)->create();

Learn more

Related terms

Added 2026-11-30 · Last reviewed 2026-11-30