*/ class ClientContactFactory extends Factory { /** * Define the model's default state. * * @return array */ public function definition(): array { return [ 'client_id' => Client::factory(), 'full_name' => fake()->name(), 'job_title' => fake()->jobTitle(), 'email' => fake()->unique()->safeEmail(), 'phone' => fake()->phoneNumber(), 'is_principal' => false, ]; } /** * Mark the contact as principal. */ public function principal(): static { return $this->state(fn () => ['is_principal' => true]); } }