*/ class PressReleaseEventFactory extends Factory { /** * @return array */ public function definition(): array { return [ 'press_release_id' => PressRelease::factory(), 'type' => PressReleaseEventType::View, 'channel' => null, ]; } public function share(?PressReleaseShareChannel $channel = null): static { return $this->state([ 'type' => PressReleaseEventType::Share, 'channel' => $channel ?? fake()->randomElement(PressReleaseShareChannel::cases()), ]); } }