startDate; } /** * Получить конец диапазона в Carbon */ public function end(): Carbon { return $this->endDate; } /** * Получить начало диапазона в SQL формате */ public function startSql(): string { return $this->startDate->format('Y-m-d H:i:s'); } /** * Получить конец диапазона в SQL формате */ public function endSql(): string { return $this->endDate->format('Y-m-d H:i:s'); } /** * Получить начало диапазона как timestamp */ public function startTimestamp(): int { return $this->startDate->getTimestampMs(); } /** * Получить конец диапазона как timestamp */ public function endTimestamp(): int { return $this->endDate->getTimestampMs(); } /** * Проверить, является ли дата сегодняшней */ public function isEndDateToday(): bool { return $this->endDate->isToday(); } /** * Получить диапазон дней */ public function getDaysRange(): Collection { $days = collect(); $current = $this->startDate->copy(); while ($current->lte($this->endDate)) { $days->push($current->copy()); $current->addDay(); } return $days; } }