lse123
4 months ago
453
3
Laravel

can you tell why can not seed users table -- error!!!

Posted 4 months ago by lse123

[email protected]:~/MyApp$ php artisan db:seed --class=UserSeeder

Illuminate\Contracts\Container\BindingResolutionException

Target class [UserSeeder] does not exist.

at vendor/laravel/framework/src/Illuminate/Container/Container.php:807 803| 804| try { 805| $reflector = new ReflectionClass($concrete); 806| } catch (ReflectionException $e) {

807| throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e); 808| } 809| 810| // If the type is not instantiable, the developer is attempting to resolve 811| // an abstract type such as an Interface or Abstract Class and there is

  +24 vendor frames

25 artisan:37 Illuminate\Foundation\Console\Kernel::handle() [email protected]:~/MyApp$

class UserSeeder extends Seeder { /** * Seed the application's database. * * @return void */ public function run() {

    DB::table('users')->insert([
        'name' => Str::random(10),
        'email' => Str::random(10).'@gmail.com',
        'password' => Hash::make('password'),
    ]);
}

}

Please sign in or create an account to participate in this conversation.