Add online transaction log, group all the debug tool into 1 home page

This commit is contained in:
Afiq Hamzah
2024-08-01 13:56:39 +08:00
parent 0733632277
commit 746847c67c
7 changed files with 241 additions and 11 deletions
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
use Carbon\Carbon;
class OnlineTransactionLogController extends Controller
{
public function __invoke(Request $request)
{
$date = request()->selectedDate ?? Carbon::now()->toDateString();
$transactionLog = Http::get(config('api.url') . '/api/transaction/online/log', ['date' => $date])->json();
$logs = collect($transactionLog)->groupBy('bill_id');
return view('online.log.index', compact('logs', 'date'));
}
}