Laravel 13 · Models and database

Create and run a seeder

Create a seeder, add its data in run(), then execute that seeder.

php artisan make:seeder PostSeeder
php artisan db:seed --class=PostSeeder

Caution: Seeders write to the configured database. Review their contents before running them.

Official Laravel 13 documentation

More models and database commands

All models and database commands · Laravel 13 cheatsheet

Was this page helpful?