@php $columns = [ ['label' => 'Id', 'column' => 'id', 'sort' => true], ['label' => 'Customer name', 'column' => 'first_name', 'sort' => true], ['label' => 'Delivery type', 'column' => 'delivery_type', 'sort' => true], ['label' => 'Pickup/Delivery Date', 'column' => 'date', 'sort' => true], ['label' => 'Order Date', 'column' => 'created_at', 'sort' => true], ['label' => 'Order Type', 'column' => 'shipping_method', 'sort' => true], ['label' => 'Sub total', 'column' => 'total_amount', 'sort' => true], ['label' => 'Grand total', 'column' => 'grand_total', 'sort' => true], ['label' => 'Order status', 'column' => 'status', 'sort' => false], ['label' => 'Picked Up/Delivered Date', 'column' => 'date', 'sort' => true], ['label' => 'Actions', 'column' => 'action', 'sort' => false], ]; $bulkOptions = [ [ 'label' => 'Status', 'value' => '2', 'options' => [ [ 'label' => 'Active', 'value' => '1', ], [ 'label' => 'Inactive', 'value' => '0', ], ], ], ]; @endphp
@csrf
To
@foreach ($orders as $key => $item) {{ $item->id }} {{ $item->name . ' ' . $item->lastname }} {{ $item->delivery_type }} @if ($item->date) {{ \Carbon\Carbon::parse($item->date)->format('d-m-Y') }} @endif {{ $item->time }} {{ $item->created_at->format('d-m-Y') }} {{ $item->shipping_method }} $ {{ number_format($item->total_amount + $item->tax_total ?? 0, 2) }} $ {{ number_format($item->grand_total ?? 0, 2) }} {{ $item->status }} {{-- @switch($item->status) @case('pending') Pending @break @case('cancel') Cancelled @break @case('complete') Complete @break @default @endswitch --}} @if ($item->delivery_date) {{ \Carbon\Carbon::parse($item->delivery_date)->format('d-m-Y') }} @endif @endforeach