selectedDate ?? Carbon::now()->toDateString(); try { $response = Http::get(config('api.url_arrahn_portal') . '/api/billplz-transaction-review', ['date' => $date]); if ($response->failed()) { throw new \Exception('ArrahnPay portal returned ' . $response->status()); } [$pkbTransactionsReview, $kopkbTransactionsReview] = $response->json(); } catch (\Exception $e) { Log::error('Billplz transaction review index failed', [ 'date' => $date, 'error' => $e->getMessage(), ]); return redirect()->back()->with('errormessage', 'Portal ArrahnPay kemungkinan tidak beroperasi. Waktu Operasi Portal ArrahnPay adalah dari 7.30 AM hingga 11.30 PM'); } return view('online.billplz-transaction-review.index', compact('pkbTransactionsReview', 'kopkbTransactionsReview', 'date')); } public function show($bill_id) { try { $response = Http::get(config('api.url_arrahn_portal') . '/api/billplz-transaction-review/' . $bill_id); if ($response->failed()) { throw new \Exception('ArrahnPay portal returned ' . $response->status()); } $billPlzTransactionReview = $response->json(); $billPlzTransactionReview = array_filter($billPlzTransactionReview, fn($x) => $x[0]['billplz_latest_transaction'] !== null); $billPlzTransactionReview = array_pop($billPlzTransactionReview) ?? []; } catch (\Exception $e) { Log::error('Billplz transaction review show failed', [ 'bill_id' => $bill_id, 'error' => $e->getMessage(), ]); return redirect()->back()->with('errormessage', 'Portal ArrahnPay kemungkinan tidak beroperasi. Waktu Operasi Portal ArrahnPay adalah dari 7.30 AM hingga 11.30 PM'); } return view('online.billplz-transaction-review.show', compact('billPlzTransactionReview', 'bill_id')); } }