where("hosting_id", $hostingId); } public function scopeSinceDayAgo($query) { $now = new \DateTime(); $now->modify('-24 hours'); return $query->where("time", ">=",$now->format("Y-m-d H:i:s")); } public function scopeSinceHourAgo($query) { $now = new \DateTime(); $now->modify('-1 hours'); return $query->where("time", ">=",$now->format("Y-m-d H:i:s")); } public function scopeOlderThanDayAgo($query) { $now = new \DateTime(); $now->modify('-24 hours'); return $query->where("time", "<=",$now->format("Y-m-d H:i:s")); } }