@extends('cleaner.layouts.loggedin') @section('title', 'Cleaner Dashboard') @section('content')

Your orders

Filter by
Delivery Dates Delivery Tomorrow Delivery {{ \Carbon\Carbon::today()->addDays(2)->format('m-d-y') }} Latest orders Completed orders

@foreach ($orders as $order) @php $completeBy = new DateTime($order->completeby); $now = new DateTime(); $now->setTime(0, 0, 0); // Set time to start of the day $interval = $now->diff($completeBy); $diffInDays = $interval->days; if ($completeBy < $now) { $diffInDays = abs($diffInDays); $diffInDays = '-' . $diffInDays; $is_negative = true; } else { $diffInDays = $diffInDays; $is_negative = false; } $diffInDays = $diffInDays . ' day(s)'; if (strtolower($order->status) == 'completed') { $diffInDays = 'completed'; $is_negative = false; } @endphp @endforeach
@endsection