lundi 18 janvier 2021

laravel-8 user table seeder does not exist

I am trying to make a login from laravel 8 but at the begging I faced an error which I cannot find a solution. The UsersTablesSeeder is created but still the compiler cannot find it

   Illuminate\Contracts\Container\BindingResolutionException 

  Target class [UsersTablesSeeder] does not exist.

  at C:\xampp\htdocs\pary\vendor\laravel\framework\src\Illuminate\Container\Container.php:832
    828▕ 
    829▕         try {
    830▕             $reflector = new ReflectionClass($concrete);
    831▕         } catch (ReflectionException $e) {
  ➜ 832▕             throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
    833▕         }
    834▕ 
    835▕         // If the type is not instantiable, the developer is attempting to resolve
    836▕         // an abstract type such as an Interface or Abstract Class and there is

  1   C:\xampp\htdocs\pary\vendor\laravel\framework\src\Illuminate\Container\Container.php:830
      ReflectionException::("Class "UsersTablesSeeder" does not exist")

  2   C:\xampp\htdocs\pary\vendor\laravel\framework\src\Illuminate\Container\Container.php:830
      ReflectionClass::__construct("UsersTablesSeeder")

the following code shows DatabaseSeeder.php

<?php

use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;

class DatabaseSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        Eloquent::unguard();
        $this->call(UsersTablesSeeder::class);
    }
}

this is my user table

<?php

use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
use App\User;

class UsersTablesSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        User::create([
            'name'    => 'John Smith',
            'email'    => 'john_smith@gmail.com',
            'password'   =>  Hash::make('password'),
            'remember_token' =>  str_random(10),
        ]);
    }
}

I am following this link



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire