@php use Carbon\Carbon; $revisedDayEndPendingBranches = []; if(isset($filDate)){ $branchSoftStartDates = DB::table('gnr_branch')->pluck('softwareStartDate', 'branchCode')->all(); foreach($monthEndPendingBranches as $pendingBranch){ $code = (int)explode('-', $pendingBranch)[0]; $softwareStartDate = $branchSoftStartDates[$code] ?? null; if(Carbon::parse($softwareStartDate)->lte(Carbon::parse($filDate))){ $revisedDayEndPendingBranches[] = $pendingBranch; } } $monthEndPendingBranches = $revisedDayEndPendingBranches; $monthEndPendingBranches = array_diff($monthEndPendingBranches, ['000 - Head Office', '400 - Project Office', '100 - Bhaberchar- Gri', '100 - Gazaria- Gri']); } @endphp @if (isset($monthEndPendingBranches)) @if (count($monthEndPendingBranches)>0)