title: Laravel 8 - Model factory class not found when creating a dummy data
body: <p>I'm currently following the laravel from scratch series from laracasts and I got stuck on this problem since the laravel version on that series is laravel 6. I already searched for an answer here and found a similar thread but my case is different, since i installed a fresh laravel 8 version.</p>
  <p>I'm creating a dummy data using the factory model class using this command on tinker:</p>
  <pre><code>Article::factory()-&gt;count(1)-&gt;make();
  </code></pre>
  <p>And this is the error I'm getting:</p>
  <pre><code>PHP Fatal error:  Class 'Article' not found in Psy Shell code on line 1
  </code></pre>
  <p>Here's my model Article.php</p>
  <pre><code>&lt;?php
  
  namespace App\Models;
  
  use Illuminate\Database\Eloquent\Factories\HasFactory;
  use Illuminate\Database\Eloquent\Model;
  
  class Article extends Model
  {
      use HasFactory;
      protected $guarded = [];
  }
  </code></pre>
  <p>Here's my factory ArticleFactory.php</p>
  <pre><code>&lt;?php
  
  namespace Database\Factories;
  
  use App\Models\Article;
  use App\Models\User;
  use Illuminate\Database\Eloquent\Factories\Factory;
  
  class ArticleFactory extends Factory
  {
      /**
       * The name of the factory's corresponding model.
       *
       * @var string
       */
      protected $model = Article::class;
  
      /**
       * Define the model's default state.
       *
       * @return array
       */
      public function definition()
      {
          return [
              'user_id' =&gt; User::factory(),
              'title' =&gt; $this-&gt;faker-&gt;sentence,
              'excerpt' =&gt; $this-&gt;faker-&gt;sentence,
              'body' =&gt; $this-&gt;faker-&gt;paragraph
          ];
      }
  }
  </code></pre>
  <p>I tried creating a dummy data using the default model and factory for User and it's perfectly working. I was using the same code on tinker:</p>
  <pre><code>&gt;&gt;&gt; User::factory()-&gt;count(1)-&gt;make();
  [!] Aliasing 'User' to 'App\Models\User' for this Tinker session.
  =&gt; Illuminate\Database\Eloquent\Collection {#3289
       all: [
         App\Models\User {#3294
           name: &quot;Lane Maggio I&quot;,
           email: &quot;tromp.deion@example.com&quot;,
           email_verified_at: &quot;2020-10-19 15:08:24&quot;,
         },
       ],
     }
  </code></pre>