subHours(24); return Order::Preparation()->where('updated_at', '>', $date)->count(); } public static function countPreparationLess48h() { $date = now()->subHours(48); return Order::Preparation()->where('updated_at', '>', $date)->count(); } public static function countPreparationMore48h() { $date = now()->subHours(48); return Order::Preparation()->where('updated_at', '<', $date)->count(); } public static function countOfToday() { return Order::ofToday()->count(); } public static function countOfLastWeek() { return Order::ofLastWeek()->count(); } public static function countOfLastMonth() { return Order::ofLastMonth()->count(); } public static function getTotalOfToday() { return Order::ofToday()->sum('total_taxed'); } public static function getTotalOfLastWeek() { return Order::ofLastWeek()->sum('total_taxed'); } public static function getTotalOfLastMonth() { return Order::ofLastMonth()->sum('total_taxed'); } public static function getModel() { return Order::query(); } }