Add timestamp when viewing logs

This commit is contained in:
Afiq Hamzah
2024-10-05 11:44:06 +08:00
parent 6c8aa9c2de
commit 07cc84c558
2 changed files with 14 additions and 2 deletions
+7 -1
View File
@@ -58,7 +58,13 @@
<span class="acccordian-arrow float-right">&#9660;</span>
</button>
<div class="accordion-content hidden">
@foreach ($logs as $log)
@foreach ($logs as $log)
<div class="bg-gray-600 text-white border-black p-0 pl-3 py-1 flex justify-between items-center">
@php
$formatTime = fn($x) => \Carbon\Carbon::createFromFormat('d/m/Y H:i:s', $x)->format('m/d/Y g:i:s A')
@endphp
<span>{{ $formatTime($log['created_at']) }}</span>
</div>
<div class="bg-gray-500 text-white border-black p-3 flex justify-between items-center">
<span>{{ $log['status_label'] }}</span>
<span
+7 -1
View File
@@ -22,7 +22,7 @@
<div class="container mx-auto p-4 bg-yellow-50">
@forelse ($logs as $bill_id => $logs)
<div class="mb-4">
<button class="accordion-toggle w-full bg-gray-600 text-gray-100 p-2 text-left focus:outline-none">
<button class="accordion-toggle w-full bg-gray-700 text-gray-100 p-2 text-left focus:outline-none">
<h2 class="inline-block">Bill ID: {{ $bill_id }}</h2>
@php
$extractedCustomerName = json_decode($logs[0]['payload']) != null && $logs[0]['status'] == '1' ? json_decode($logs[0]['payload'])[3] : 'error';
@@ -36,6 +36,12 @@
</button>
<div class="accordion-content hidden">
@foreach ($logs as $log)
<div class="bg-gray-600 text-white border-black p-0 pl-3 py-1 flex justify-between items-center">
@php
$formatTime = fn($x) => \Carbon\Carbon::createFromFormat('d/m/Y H:i:s', $x)->format('m/d/Y g:i:s A')
@endphp
<span>{{ $formatTime($log['created_at']) }}</span>
</div>
<div class="bg-gray-500 text-white border-black p-3 flex justify-between items-center">
<span>{{ $log['status_label'] }}</span>
<span