In this article, I will show you how to run all seeders in Laravel 9 instead of running individual seeders. In order to run all seeders in Laravel, you must first create individual seeders using the artisan command below: php artisan make:seeder AdminSeeder

Create another seeder for user as show below: php artisan make:seeder UserSeeder When you run, you get the following function: public function run() { User::create(["name" => "User lastname", "email" => "user@gmail.com", "password" => bcrypt("123456")]); } In order to run the specific seeders, you can do this by running the below commad: php artisan db:seed --class=AdminSeeder
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners