*/ final class EventInvitationFactory extends Factory { protected $model = EventInvitation::class; public function definition(): array { return [ 'event_id' => Event::factory(), 'user_id' => User::factory(), 'rsvp_status' => RsvpStatus::Pending, 'rsvp_note' => null, 'rsvp_responded_at' => null, 'invited_at' => now(), ]; } public function pending(): static { return $this->state(fn () => [ 'rsvp_status' => RsvpStatus::Pending, 'rsvp_responded_at' => null, ]); } public function available(): static { return $this->state(fn () => [ 'rsvp_status' => RsvpStatus::Available, 'rsvp_responded_at' => now(), ]); } public function unavailable(): static { return $this->state(fn () => [ 'rsvp_status' => RsvpStatus::Unavailable, 'rsvp_responded_at' => now(), ]); } public function tentative(): static { return $this->state(fn () => [ 'rsvp_status' => RsvpStatus::Tentative, 'rsvp_responded_at' => now(), 'rsvp_note' => fake()->sentence(), ]); } }