芝麻web文件管理V1.00
编辑当前文件:/home/digitalh/yeahea.digitalhubbd.com/app/Helpers/Period.php
subDays($numberOfDays)->startOfDay(); return new static($startDate, $endDate); } public static function months(int $numberOfMonths): self { $endDate = Carbon::today(); $startDate = Carbon::today()->subMonths($numberOfMonths)->startOfDay(); return new static($startDate, $endDate); } public static function years(int $numberOfYears): self { $endDate = Carbon::today(); $startDate = Carbon::today()->subYears($numberOfYears)->startOfDay(); return new static($startDate, $endDate); } public function __construct(DateTime $startDate, DateTime $endDate) { if ($startDate > $endDate) { throw InvalidPeriod::startDateCannotBeAfterEndDate($startDate, $endDate); } $this->startDate = $startDate; $this->endDate = $endDate; } }