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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners