title: \Database\QueryException SQLSTATE[42S02]: Base table or view not found: 1146 Table 'homestead.Users' doesn't exist (SQL: truncate table `Users`)
body: <p>i am trying to run:</p>
  <p>php artisan db:seed</p>
  <p>and i get this error:</p>
  <pre><code>   Illuminate\Database\QueryException
  
    SQLSTATE[42S02]: Base table or view not found: 1146 Table 'homestead.Users' doesn't exist (SQL: truncate table `Users`)
  </code></pre>
  <p>this is the code from databaseseeder.php:</p>
  <p>as you can see , i truncate the users table which is created in user.php MODEL, database seeder code here:</p>
  <pre><code>public function run()
      {
          // \App\Models\User::factory(10)-&gt;create();
  
          DB::statement('SET FOREIGN_KEY_CHECKS=0');
  
          User::truncate();
          Category::truncate();
          Product::truncate();
          Transaction::truncate();
          DB::table('category_product')-&gt;truncate();
  
          $cantidadUsuarios = 200;
          $cantidadCategories = 30;
          $cantidadProductos = 1000;
          $cantidadTransacciones = 1000;
  
          factory(User::class, $cantidadUsuarios)-&gt;create();
          factory(Category::class, $cantidadCategories)-&gt;create();
  
          factory(Category::class, $cantidadTransacciones)-&gt;create()-&gt;each(
              function ($producto) {
                  $categorias = Category::all()-&gt;random(mt_rand(1, 5))-&gt;pluck('id');
                  $producto-&gt;categories()-&gt;attach($categories-&gt;first());
              }
          );
          factory(Transaction::class, $cantidadTransacciones)-&gt;create();
      }
  }
  </code></pre>
  <p>here is the user model class:</p>
  <p>as you can see i am defining the table name in:</p>
  <pre><code>public $table = &quot;Users&quot;;
  </code></pre>
  <p>the solution came from here: <a href="https://stackoverflow.com/questions/30159257/base-table-or-view-not-found-1146-table-laravel-5">Base table or view not found: 1146 Table Laravel 5</a></p>
  <p>but still does not works, i also... ran <code>&quot;php artisan migrate&quot;</code> , to make sure i am not leaving something out,</p>
  <p>then i ran php artisan db:seed, however did not worked out,</p>
  <p>User.php model class:</p>
  <pre><code>&lt;?php
  
  namespace App\Models;
  
  use Illuminate\Contracts\Auth\MustVerifyEmail;
  use Illuminate\Database\Eloquent\Factories\HasFactory;
  use Illuminate\Foundation\Auth\User as Authenticatable;
  use Illuminate\Notifications\Notifiable;
  
  class User extends Authenticatable
  {
  
      public $table = &quot;Users&quot;;
  
      use HasFactory, Notifiable;
  
      const USUARIO_VERIFICADO = '1';
  
      const USUARIO_NO_VERIFICADO = '0';
  
      const USUARIO_ADMINISTRADOR = 'TRUE';
  
  
      const USUARIO_REGULAR = 'FALSE';
  
      /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
      protected $fillable = [
          'name',
          'email',
          'password',
          'verified',
          'verification_token',
          'admin',
  
      ];
  
      /**
       * The attributes that should be hidden for arrays.
       *
       * @var array
       */
      protected $hidden = [
          'password',
          'remember_token',
          'verification_token',
      ];
  
      /**
       * The attributes that should be cast to native types.
       *
       * @var array
       */
      protected $casts = [
          'email_verified_at' =&gt; 'datetime',
      ];
  
      public function esVerificado()
      {
          return $this-&gt;verified == User::USUARIO_VERIFICADO;
      }
  
      public function esAdministrador()
      {
          return $this-&gt;verified == User::USUARIO_ADMINISTRADOR;
      }
  
      public static function generarVerificationToken()
      {
          return str_random(40);
      }
  }
  </code></pre>
  <p>and also here is the USERS CREATE MIGRATION CLASS:</p>
  <pre><code>&lt;?php
  
  use Illuminate\Database\Migrations\Migration;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Support\Facades\Schema;
  use App\Models\User;
  
  class CreateUsersTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('users', function (Blueprint $table) {
              $table-&gt;increments('id');
              $table-&gt;string('name');
              $table-&gt;string('email')-&gt;unique();
              $table-&gt;timestamp('email_verified_at')-&gt;nullable();
              $table-&gt;string('password');
              $table-&gt;rememberToken();
              $table-&gt;string('verified')-&gt;default(User::USUARIO_NO_VERIFICADO);
              $table-&gt;string('verification_token')-&gt;nullable();
              $table-&gt;string('admin')-&gt;default(User::USUARIO_REGULAR);
              $table-&gt;timestamps();
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::dropIfExists('users');
      }
  }
  </code></pre>
  <p>i do not know what i am doing wrong, so i come here seeking for some light from StackOverflow community to help me, since i  do not know what is wrong and i am just starting with laravel,</p>
  <p>i submmited all the useful information in order to determine what is the problem</p>
  <p>if you need something else please feel free to request it, thank you
  thank you</p>