title: Laravel 8 BadMethodCallException
body: <p>I am learning laravel 8, I keep getting this error</p>
  <pre><code>   BadMethodCallException 
  
    Call to undefined method App\Models\Question::factory()
  
    at C:\Users\USER\Desktop\laravels\qna\vendor\laravel\framework\src\Illuminate\Support\Traits\ForwardsCalls.php:50
       46▕      * @throws \BadMethodCallException
       47▕      */
       48▕     protected static function throwBadMethodCallException($method)
       49▕     {
    ➜  50▕         throw new BadMethodCallException(sprintf(
       51▕             'Call to undefined method %s::%s()', static::class, $method
       52▕         ));
       53▕     }
       54▕ }
  
    • Bad Method Call: Did you mean App\Models\Question::toArray() ?
  
    1   C:\Users\USER\Desktop\laravels\qna\vendor\laravel\framework\src\Illuminate\Support\Traits\ForwardsCalls.php:36
        Illuminate\Database\Eloquent\Model::throwBadMethodCallException(&quot;factory&quot;)
  
    2   C:\Users\USER\Desktop\laravels\qna\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php:1993
        Illuminate\Database\Eloquent\Model::forwardCallTo(Object(Illuminate\Database\Eloquent\Builder), &quot;factory&quot;)
  </code></pre>
  <p>I am in the DatabaseSeeder.php file and I think the issue is coming from this code:</p>
  <pre><code>public function run()
  {
      \App\Models\User::factory(3)-&gt;create()-&gt;each(function($u) {
          $u-&gt;questions()
            -&gt;saveMany(
              //   factory(App\Question::class, rand(1,5))-&gt;make()
              \App\Models\Question::factory(rand(1,5))-&gt;make()
            );
      });
  }
  </code></pre>
  <p>I get something similar after running this command in tinker:</p>
  <pre><code>&gt;&gt;&gt; \App\Models\Question::factory(3)-&gt;make();
  </code></pre>
  <p>Link to repo is <a href="https://github.com/Bayurzx/qna" rel="nofollow noreferrer">here</a>
  Any pointer will be appreciated!</p>