Level 104
You want the end of the salary_to_date?
Carbon::parse($request->salary_to_date)->endOfDay()
Otherwise, the time is 00:00:00
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am trying to get the data between dates. I have used whereBetween() function when I search data for 10 days it gives me only 9 days of data...
I have set the database column data type as date.
and I am filtering on created_at field.
$absent_count = tbl_attendance::join("tbl_workers", "tbl_workers.worker_id", "tbl_attendances.attendance_worker_id")
->where("tbl_attendances.attendance_worker_presense", "A")
->where("tbl_workers.worker_id", $wrker->worker_id)
->whereBetween("tbl_attendances.created_at", [Carbon::parse($request->salary_from_date), Carbon::parse($request->salary_to_date)])->count();
You want the end of the salary_to_date?
Carbon::parse($request->salary_to_date)->endOfDay()
Otherwise, the time is 00:00:00
Please or to participate in this conversation.