Fix billplzTransactionReview page by conversion of collection to array

This commit is contained in:
Afiq Hamzah
2025-01-26 16:37:25 +08:00
parent 3052644909
commit fbc2510ef3
@@ -20,7 +20,7 @@ class BillplzTransactionReviewController extends Controller
$billplzTransactionReview = array_map(function($company_code) use($date){
$billplzService = new BillplzService($company_code);
return $billplzService->getBillplzTransactionReview($date);
return $billplzService->getBillplzTransactionReview($date)->toArray();
}, $companyMapping);
return response()->json(array_merge(...$billplzTransactionReview), 200);
@@ -35,7 +35,7 @@ class BillplzTransactionReviewController extends Controller
$billplzTransactionReview = array_map(function($company_code) use($request){
$billplzService = new BillplzService($company_code);
return $billplzService->getBillplzTransactionReviewByBillId($request->bill_id);
return $billplzService->getBillplzTransactionReviewByBillId($request->bill_id)->toArray();
}, $companyMapping);
return response()->json($billplzTransactionReview, 200);