From 7ed2031edd67909df37afbeb426b0fb956f8f79d Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Wed, 28 Aug 2024 21:02:50 +0800 Subject: [PATCH] Laravel Vapor - debug billingData.csv cannot be exported --- .../Exports/Services/ExportsAnalyticBillingTransactions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsAnalyticBillingTransactions.php b/app/Classes/Modules/Exports/Services/ExportsAnalyticBillingTransactions.php index 6f2ed686..3aad5c9d 100644 --- a/app/Classes/Modules/Exports/Services/ExportsAnalyticBillingTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsAnalyticBillingTransactions.php @@ -53,7 +53,11 @@ class ExportsAnalyticBillingTransactions implements FromCollection, WithHeadings */ public function collection() { - return Transaction::where('type', 3)->where('created_at', '>=', Carbon::now()->subYear())->get(); + return Transaction::where('type', 3) + ->where('created_at', '>=', Carbon::now()->subYear()) + ->orderBy('created_at', 'desc') + ->take(10) + ->get(); } /**