title: Factories Not Found in Laravel 6
body: <p>I'm stuck... I'm trying to get a set of factories working in Laravel 6, an continuously get the following error:</p>
  
  <pre><code>InvalidArgumentException with message 'Unable to locate factory with name [default] [User].'
  </code></pre>
  
  <p>There's several other posts about this on here and around the web, and I've tried all of those solutions. My code for the factories is as follows: </p>
  
  <pre><code>&lt;?php
  
  /** @var \Illuminate\Database\Eloquent\Factory $factory */
  
  use App\Thread;
  use Faker\Generator as Faker;
  
  $factory-&gt;define(Thread::class, function (Faker $faker) {
      return [
          'user_id' =&gt; function () {
              return factory('App\User')-&gt;create()-&gt;id;
          },
          'title' =&gt; $faker-&gt;sentence,
          'body' =&gt; $faker-&gt;paragraph
      ];
  });
  </code></pre>
  
  <p>I'm using php artisan tinker to try and generate DB entries so I can work on the rest of my models etc. The command I'm using is as follows:</p>
  
  <pre><code>factory('Thread',50)-&gt;create()
  </code></pre>
  
  <p>I've tried specifying the name space in the factory call, I've tried putting it in double quotes, I've tried adding the '::class' at the end. The controllers are there, the models are there, the migrations are working as expected, but every time I run the factory in tinker, it won't give it to me. Most of the documentation that I've found is referencing older versions of Laravel as well, so I'm not sure if they are providing me with correct syntax. </p>
  
  <p>It's worth noting, the stock provided UserFactory doesn't work either. This is a fresh download of Laravel 6 that I did today to go through a course over at Laracasts. The course is older, focused on Laravel 5.4, but I can figure out the conversion... I just can't get this to work to save my life and I can't figure out why. </p>
  
  <p>I've got the whole project uploaded here if you want to view additional code: <a href="https://github.com/aarpie100/laracasts_forum" rel="nofollow noreferrer">https://github.com/aarpie100/laracasts_forum</a> </p>
  
  <p>Help?</p>