{{-- This page is rendered by orders() method inside Admin/OrderController.php --}} @extends('admin.layout.layout') @section('content')

Orders

{{-- DataTable --}} {{-- using the id here for the DataTable --}} @php // dd($orders); // check if the authenticated/logged-in user is 'vendor' (show ONLY orders of products belonging to them), or 'admin' (show ALL orders) @endphp @foreach ($orders as $order) @if ($order['orders_products']) {{-- If the 'vendor' has ordered products (if a 'vendor' product has been ordered), show them. Check how we constrained the eager loads using a subquery in orders() method in Admin/OrderController.php inside the if condition --}} @endif @endforeach
Order ID Order Date Customer Name Customer Email Ordered Products Order Amount Order Status Payment Method Actions
{{ $order['id'] }} {{ date('Y-m-d h:i:s', strtotime($order['created_at'])) }} {{ $order['name'] }} {{ $order['email'] }} @foreach ($order['orders_products'] as $product) {{ $product['product_code'] }} ({{ $product['product_qty'] }})
@endforeach
{{ $order['grand_total'] }} {{ $order['order_status'] }} {{ $order['payment_method'] }} {{-- Icons from Skydash Admin Panel Template --}}    {{-- View HTML invoice --}} {{-- Icons from Skydash Admin Panel Template --}}    {{-- View PDF invoice --}} {{-- Icons from Skydash Admin Panel Template --}}
@endsection