*/ class WorkspaceInviteFactory extends Factory { /** * Define the model's default state. * * @return array */ public function definition(): array { return [ 'workspace_id' => Workspace::factory(), 'invited_by' => User::factory(), 'email' => fake()->unique()->safeEmail(), 'token' => Str::random(64), 'role' => Role::Member, 'status' => InviteStatus::Pending, ]; } public function accepted(): static { return $this->state(fn (array $attributes) => [ 'status' => InviteStatus::Accepted, 'accepted_at' => now(), ]); } }