subHours(24); $end = Carbon::now(); return Order::preparation()->byPeriod($start, $end, 'updated_at')->count(); } public static function countInPreparationLess48H() { $start = Carbon::now()->subHours(48); $end = Carbon::now(); return Order::preparation()->byPeriod($start, $end, 'updated_at')->count(); } public static function countInPreparationMore48H() { $start = Carbon::now()->subHours(48); return Order::preparation()->where('updated_at', '>', $start)->count(); } public static function getTotalByPeriod($start, $end) { return self::sumByPeriod($start, $end, 'total_shipped'); } public static function getModel() { return Order::query(); } }