cutigersfan
1 month ago
511
7
Laravel

Laravel 8 Team::factory() not found

Posted 1 month ago by cutigersfan

I'm using the following in my UserFactory:

    public function definition()
    {
        return [
            'first_name' => $this->faker->firstName,
            'last_name' => $this->faker->lastName,
//            'name' => $this->faker->name,
            'email' => $this->faker->unique()->safeEmail,
            'email_verified_at' => now(),
            'password' => 'yIXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
            'remember_token' => Str::random(10),
            'current_team_id' => Team::factory()
        ];


    }

When run the seeder, I get the following error:

   BadMethodCallException 

  Call to undefined method App\Models\Team::factory()

Any thoughts? This seems so silly, but it's frustrating me.

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