I'm working with seeder to fill my users table, so I created a new seeder called UserSeeder and then I added these codes to it:
public function run()
{
foreach(range(1,10) as $item)
{
DB::table('users')->insert([
'name' => "name $item",
'email' => "email $item",
'email_verified_at' => now(),
'password' => "password $item"
]);
}
}
After that I tried php artisan db:seed --class=UserSeeder but it shows me:
Error
Class 'Database\Seeders\DB' not found
which is related to this line:
DB::table('users')->insert([
So why it is not found there, what should I do now?