Unable to locate factory with name [default]??

Posted 3 years ago by zachleigh

Trying to get Auth up and running on a project and Im running into trouble making model factories for testing. Im getting the following error when trying to create a model with a factory: Unable to locate factory with name [default]
Heres my test:


namespace App\Tests\Integration;

use App\Tests\TestCase;

class AuthTest extends TestCase
     * @test
    public function it_logs_in_user()

And my ModelFactorys file:


$factory->define(App\User::class, function (Faker\Generator $faker) {
    return [
        'name' => $faker->name,
        'email' => $faker->email,
        'password' => str_random(10),
        'remember_token' => str_random(10),

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.