public function wasWithinLast($timeInterval) { $now = new static(); $interval = $now->copy()->modify('-' . $timeInterval); $thisTime = $this->format('U'); return $thisTime >= $interval->format('U') && $thisTime <= $now->format('U'); }