@php $item = $order->items->first(); $thumb = $item?->product_thumbnail ?? $item?->product?->thumbnail; $courierName = \App\Models\CourierApi::displayName($order->courier_type); $isSteadfast = strtolower($order->courier_type ?? '') === 'steadfast'; $isPathao = strtolower($order->courier_type ?? '') === 'pathao'; $isApiTracked = $order->isApiCourierTracked(); $statusTime = $order->shipped_at ?? $order->updated_at; $isPreCourierStage = in_array($order->fulfillment_stage, [ \App\Models\Order::STAGE_ACCEPTED, \App\Models\Order::STAGE_READY_BOOKING, ], true); $fulfillmentStageLabel = match ($order->fulfillment_stage) { \App\Models\Order::STAGE_ACCEPTED => 'Collection', \App\Models\Order::STAGE_READY_BOOKING => 'Booking', \App\Models\Order::STAGE_BOOKED => 'Packing', \App\Models\Order::STAGE_PACKED => 'Packed', default => null, }; @endphp
@if($thumb) @else
@endif
{{ $order->customer_phone }}
{{ $order->created_at->format('M j, Y g:i A') }}
@if($order->courier_type)
Courier: {{ $courierName }}
@endif @if($order->consignment_id)
{{ $order->consignment_id }}
@endif
{{ $order->customer_name }}
@if($order->district || $order->upazila)
{{ $order->district }}@if($order->upazila) >> {{ $order->upazila }}@endif
@endif @if($order->shipping_address)
{{ $order->shipping_address }}
@endif @if($order->admin_note)
@include('backEnd.order.partials.order-note-list', [ 'noteText' => $order->admin_note, ])
@endif @if($order->approvedByUser)
{{ $order->approvedByUser->name }}
@if($order->confirmed_at)
{{ $order->confirmed_at->format('M j, Y g:i A') }}
@endif @else @endif
৳{{ number_format($order->amount) }}
{{ $order->payment_method === 'cod' ? 'Cash on Delivery' : ucfirst($order->payment_method) }}
@if($isPreCourierStage)
{{ $fulfillmentStageLabel }}
@elseif($isApiTracked)
{{ $order->trackingStatusLabel() }}
API synced
@else @endif
{{ $statusTime ? $statusTime->format('M j, Y g:i A') : '—' }}
@if(!in_array($order->order_status, [5,6]) && !$isApiTracked) @endif