Order Management {{ auth()->user()->hasRole('admin') ? 'This Order List is from the customer. Admin is able to manage the orders by updating the status (Completed or Canceled) and create the new orders.' : 'You create, edit, view and pay the orders on this page.' }} @if(auth()->user()->hasRole('admin'))
Add Order
@endif

Order List

@foreach ($orders as $i => $order) {{ $loop->iteration }}. {{ $order->id }} {{ $order->user->name ?? 'N/A' }} {{ $order->order_total_price }} {{ date('Y-m-d H:i:s', strtotime($order->order_datetime)) }} {{ ucfirst($order->order_status) }} @if(auth()->user()->hasRole('admin')) @if ($order->order_status == 'Completed') @else @endif @else @endif @endforeach