@php $start_date = date('Y-m-1'); $end_date = date('Y-m-t'); $datas = App\Models\TestCandidates::whereDate('ScheduledDate', '>=', $start_date) ->whereDate('ScheduledDate', '<=', $end_date) ->orderBy('TestCandidateID', 'desc') ->get(); $data_count = App\Models\TestCandidates::whereDate('ScheduledDate', '>=', $start_date) ->whereDate('ScheduledDate', '<=', $end_date) ->count(); @endphp