@forelse($orders as $order)
#{{$order->invoice_no}}
{{\Illuminate\Support\Carbon::parse($order->created_at)->format('h:i:s A')}} - {{\Illuminate\Support\Carbon::parse($order->created_at)->format('D M d')}}
@if($order->updated_at && $order->updated_at != $order->created_at)
Updated: {{\Illuminate\Support\Carbon::parse($order->updated_at)->format('h:i A')}}
@endif
@if(!empty($order->table_name)) TABLE NO. {{$order->table_name}} @else TAKE OUT @endif
ENTREES
@php // Check if order was updated (new items added) $isUpdatedOrder = $order->updated_at && $order->created_at && \Carbon\Carbon::parse($order->updated_at)->gt(\Carbon\Carbon::parse($order->created_at)->addSeconds(5)); @endphp @foreach($order->sell_lines as $index => $sell_line) @if($sell_line->product->type != 'modifier')
@if($sell_line->is_new_item && $isUpdatedOrder)
NEW ORDER
@php $itemCreated = \Carbon\Carbon::parse($sell_line->created_at ?? $order->updated_at ?? $order->created_at); $now = \Carbon\Carbon::now(); $diffInMinutes = $itemCreated->diffInMinutes($now); @endphp
@if($diffInMinutes < 1) JUST NOW @elseif($diffInMinutes == 1) 1 MINUTE AGO @else {{ $diffInMinutes }} MINUTES AGO @endif
@endif
{{ $sell_line->quantity }} x {{ ucfirst($sell_line->product->name) }}
@if($sell_line->product->type == 'variable')
{{ $sell_line->variations->product_variation->name ?? '' }} - {{ $sell_line->variations->name ?? '' }}
@endif @if($sell_line->modifiers && count($sell_line->modifiers) > 0) @foreach($sell_line->modifiers as $modifier_line) @if(!empty($modifier_line->variations) && !empty($modifier_line->variations->name))
{{ $modifier_line->variations->name }}
@endif @endforeach @endif @if(!empty($sell_line->sell_line_note))
NOTES: {{ $sell_line->sell_line_note }}
@endif
@endif @endforeach
Customer: {{$order->customer_name}} | @if(!empty($order->res_waiter_id)) Staff: {{$order->waiter_name ?? 'N/A'}} | @endif Location: {{$order->business_location}}
@if($orders_for == 'kitchen') @elseif($orders_for == 'waiter' && $order->res_order_status != 'served') @else @endif
@if($loop->iteration % 4 == 0) @endif @if($loop->iteration % 2 == 0)
@endif @empty

@lang('restaurant.no_orders_found')

@endforelse