title: Laravel 8 Class 'Database\Seeders\App\Models\Admin' not found
body: <p>I'm currently learning on Database Seeding in Laravel 8. When runnning the seed I got an error message</p>
  <blockquote>
  <p>Class 'Database\Seeders\App\Models\Admin' not found</p>
  </blockquote>
  <p>First I created migration database file called <strong>Admin.php</strong> in <strong>App\Models</strong> and I put these codes</p>
  <pre><code>&lt;?php
  
  namespace App\Models;
  
  use Illuminate\Notification\Notifiable;
  use Illuminate\Foundation\Auth\User as Authenticatable;
  //use Illuminate\Database\Eloquent\Factories\HasFactory;
  use Illuminate\Database\Eloquent\Model;
  
  
  class Admin extends Authenticatable
  {
      use Notifiable;
      protected $guard = 'admin';
      protected $fillable = [
          'name', 'type','email','password','image','status','created_at','updated_at',
      ];
      protected $hidden = [
          'password', 'remember_token',
      ];
  }
  </code></pre>
  <p>After that I created a seeder called <strong>AdminsTableSeeder.php</strong> and put these codes</p>
  <pre><code>&lt;?php
  
  namespace Database\Seeders;
  
  use Illuminate\Database\Seeder;
  use DB;
  
  class AdminsTableSeeder extends Seeder
  {
      /**
       * Run the database seeds.
       *
       * @return void
       */
      public function run()
      {
          DB::table('admins')-&gt;delete();
          $adminRecords = [
              [
                  'id'=&gt;1, 
                  'name'=&gt;'admin', 
                  'type'=&gt;'admin',
                  'email'=&gt;'admin@admin.com',
                  'password'=&gt;'',
                  'image'=&gt;'',
                  'status'=&gt;1,
              ],
          ];
          foreach ($adminRecords as $key =&gt; $record){
              App\Models\Admin::create($record);
          }
      }
  }
  </code></pre>
  <p>And finally on <strong>DatabaseSeeder.php</strong> I put these codes to call <strong>AdminsTableSeeder</strong></p>
  <pre><code>&lt;?php
  
  namespace Database\Seeders;
  
  use Illuminate\Database\Seeder;
  
  class DatabaseSeeder extends Seeder
  {
      /**
       * Seed the application's database.
       *
       * @return void
       */
      public function run()
      {
          $this-&gt;call(AdminsTableSeeder::class);
  
      }
  }
  </code></pre>
  <p>After I'm done with all of those, I did composer du and trying to run the seed command but I got the error message.</p>
  <p><strong>EDIT</strong>
  I already tried to modify the code from</p>
  <pre><code>foreach ($adminRecords as $key =&gt; $record){
              App\Models\Admin::create($record);
          }
  </code></pre>
  <p>to</p>
  <pre><code>foreach ($adminRecords as $key =&gt; $record){
              \App\Models\Admin::create($record);
          }
  </code></pre>
  <p>But I stil got the error message like</p>
  <blockquote>
  <p>Seeding: Database\Seeders\AdminsTableSeeder
  PHP Fatal error:  Trait 'Illuminate\Notification\Notifiable' not found in C:\xam
  pp\htdocs\tobacon_web\app\Models\Admin.php on line 11</p>
  </blockquote>
  <blockquote>
  <p>Symfony\Component\ErrorHandler\Error\FatalError</p>
  </blockquote>
  <blockquote>
  <p>Trait 'Illuminate\Notification\Notifiable' not found</p>
  </blockquote>