*/ class GuestNotificationFactory extends Factory { protected $model = GuestNotification::class; public function definition(): array { $tenantFactory = Tenant::factory(); return [ 'tenant_id' => $tenantFactory, 'event_id' => Event::factory()->for($tenantFactory), 'type' => GuestNotificationType::BROADCAST, 'title' => $this->faker->sentence(4), 'body' => $this->faker->sentences(2, true), 'payload' => null, 'audience_scope' => GuestNotificationAudience::ALL, 'target_identifier' => null, 'status' => GuestNotificationState::ACTIVE, 'priority' => 0, 'expires_at' => null, ]; } public function guestTarget(string $identifier): self { return $this->state(fn () => [ 'audience_scope' => GuestNotificationAudience::GUEST, 'target_identifier' => $identifier, ]); } public function system(GuestNotificationType $type): self { return $this->state(fn () => ['type' => $type]); } }