$conditions */ public function __construct( public SpecialOffer $offer, public string $title, public ?string $description, public string $advantage, public array $conditions, public ?CarbonImmutable $arrival = null, public ?CarbonImmutable $departure = null, public ?PriceQuote $quote = null, ) {} public function nights(): ?int { return $this->arrival && $this->departure ? (int) $this->arrival->diffInDays($this->departure) : null; } /** * Price before the discount (accommodation, extra guests, cleaning) – for "statt …". */ public function regularTotal(): ?int { return $this->quote ? $this->quote->total() + $this->quote->discount() : null; } /** * Link to the booking page, with the dates filled in when the offer has concrete dates. */ public function bookingUrl(): string { return route('booking.create', array_filter([ 'anreise' => $this->arrival?->toDateString(), 'abreise' => $this->departure?->toDateString(), ])); } /** * Stable key for the view (an offer can appear several times with different gaps). */ public function key(): string { return $this->offer->id.'-'.($this->arrival?->toDateString() ?? 'rule'); } }