Level 28
You can check your names :)
File: UserTableSeeds.php Class: UserTablesSeeder Call: UserTableSeeder
When you get them all aligned it should work :) If it doesn't - run composer dump-autoload
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
create following seed files, UserTableSeeds.php
<?php
use Illuminate\Database\Seeder;
use App\User;
class UserTablesSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
User::create([
'name' => 'Flex',
'email' => '[email protected]',
'password' => Hash::make('password'),
'remember_token' => str_random(10),
]);
}
}
DatabaseSeeder.php
<?php
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/
public function run()
{
// $this->call(UsersTableSeeder::class);
Eloquent::unguard();
$this->call('UserTableSeeder');
}
}
and run following command,
php artisan db:seed
but got following error in my cmd
reflection exception class userstableseeder does not exist
how can fix this problem?
Check your names
Your file name: UserTablesSeeder
You call: UserTableSeeder
You add s after Table
Please or to participate in this conversation.