@extends('layouts.public')
@section('title', 'My orders · ' . $table->name)
@push('head')
@endpush
@section('content')
My orders
@forelse ($orders as $order)
@php
[$label, $bg, $fg] = match ($order->status) {
'new' => ['Received', '#FBE7D3', '#8A4509'],
'preparing' => ['Being prepared', '#E3EEFB', '#0058BC'],
'ready' => ['Ready · coming!', '#E3F0E9', '#1F5C45'],
default => ['Served', '#EEEDF3', '#414755'],
};
@endphp
Order #{{ $order->id }} · {{ $order->created_at->diffForHumans() }}
{{ $label }}
@foreach ($order->items as $line)
{{ $line->quantity }} × {{ $line->name }}
@if ($line->options){{ $line->options }}@endif
${{ number_format($line->unit_price * $line->quantity, 2) }}
@endforeach
@if ($order->note)
Note: {{ $order->note }}
@endif
Order total${{ number_format($order->total, 2) }}
@empty
You haven't ordered anything yet.
@endforelse
@if ($orders->isNotEmpty())
Total for {{ $table->name }}
${{ number_format($orders->sum('total'), 2) }}
@endif
Order more
@endsection