@extends('layouts.app')
@section('content')
<h4>Orders</h4>
<table class="table table-striped bg-white">
    <tr>
        <th>#</th>
        <th>Customer</th>
        <th>Total</th>
        <th>Date</th>
        <th></th>
    </tr>
    @foreach($orders as $order)
    <tr>
        <td>{{ $order->id }}</td>
        <td>{{ $order->customer_name }}</td>
        <td>${{ $order->total }}</td>
        <td>{{ $order->created_at->format('d M Y') }}</td>
        <td><a href="/orders/{{ $order->id }}" class="btn btn-sm btn-info">View</
                    a>
        </td>
    </tr>
    @endforeach
</table>
@endsection