@php $delivered = $product->where('status', 'D'); $shipped = $product->where('status', 'S'); $processed = $product->whereIn('status', ['H', 'PC']); @endphp

Your order has been Shipped!

Dear {{$data['customer_data']->name}},

How's sitting back, relaxing and enjoying going for you?

Your order has been shipped and will be delivered timely!

So continue to enjoy life and we will inform you when your item has been delivered!

Best Regards,
{{$data['site_data']->site_regards}}

Product Status

{{-- Shipped Products Table (SECOND) --}} @if($shipped->count()) @php $lastTrack = null; @endphp

Your product has been Shipped

@foreach($shipped as $pd) @if($lastTrack !== $pd->track_no) @if($lastTrack !== null) {{-- Optional: Add a blank row or separator --}} @endif @php $lastTrack = $pd->track_no; @endphp @else @endif {{-- --}} @endforeach

Tracking No. - {{ $pd->track_no ?? 'N/A' }}

You can track your shipment by clicking the button below:

@if($pd->tracking_link) Track My Order @else N/A @endif

{{ $pd->pname }}
{{ $pd->pname }}
{{ $pd->pname }} {{ $pd->track_no ?? 'N/A' }} @if($pd->tracking_link) Track Here @else N/A @endif

@endif {{-- Delivered Products Table (FIRST) --}} @if($delivered->count())

Your product has been Delivered

@foreach($delivered as $pd) @endforeach
{{ $pd->pname }}

@endif {{-- Processed Products Table (LAST) --}} @if($processed->count())

Your product will be Delivered

@foreach($processed as $pd) @endforeach
{{ $pd->pname }}
@endif

This message was sent to you by {{$data['site_data']->site_title}}.
If you didn’t create this account, contact {{$data['site_data']->site_title}} support.