Why does this error occur? (ReflectionException : Class CountrySeeder does not exist)
Mainly for two reasons:
First Reason:– Either, we haven’t created seeder file.
Solution
Step 1. So, Create seeder file by this following command:-
php artisan make:seeder CountriesTableSeeder
Step 2. Now, Run the Seeder class individually into database
php artisan db:seed --class=CountrySeeder
Second Reason:- Or, we haven’t added the seeder file into the database/seeds/DatabaseSeeder.php file.
Solution
Step 1. Add this within the run function.
$this->call(CountriesTableSeeder::class);
public function run()
{
$this->call(UsersTableSeeder::class);
$this->call(RolesTableSeeder::class);
$this->call(CountriesTableSeeder::class);
$this->call(StatesTableSeeder::class);
}
Thanks
Laravel 5.5 CRUD Tutorial, Introduction And Agenda Overview, Laravel Training Part – 1 DevopsSchool
Latest posts by Usha Kiran (see all)
- How to Login with Token in Laravel PHP Framework? - October 30, 2021
- How to merge two or multiple tables to each other in the Laravel PHP Framework? (Part-4) - October 29, 2021
- How to display a table in a Verticle or Horizontal form in the Laravel PHP Framework? Part-2 - October 29, 2021