@foreach($orders as $order)
@php
$kotNo = $order->order_id;
$tableName = $order->table->table_name ?? ($order->orderType->name ?? 'Take Away');
$createdAt = \Carbon\Carbon::parse($order->created_at);
$elapsed = $createdAt->diffForHumans(now(), ['parts' => 2, 'short' => true]);
$status = $order->oprntl_flag ?? 'A';
if ($status === 'P') {
$statusClass = 'processing';
$statusText = 'Processing';
} elseif ($status === 'CO') {
$statusClass = 'completed';
$statusText = 'Completed';
} else {
$statusClass = 'new';
$statusText = 'New';
}
@endphp
@foreach($order->ordersItem as $item)
{{ $item->quantity }}x
{{ $item->product_name }}
@if($item->note)
{{ $item->note }}
@else
Regular
@endif
|
@endforeach
@endforeach
@endif