Hi.
I open this thread because I have a problem running these queries:
$startDate = Carbon::createFromFormat('d/m/Y', '16/06/2023')->startOfDay();
$endDate = Carbon::createFromFormat('d/m/Y', '20/06/2023')->startOfDay();
$query = Contacts::whereDate('created_at', '>=', $startDate)->get();
OR
$query = Contacts::whereBetween('created_at', [$startDate, $endDate])->get();
In the contact table I have about 9000 rows.
If I run the first or second query, it should select only the records that are present on certain dates, but unfortunately it always returns all the records.
Unfortunately, I can't figure out why the query doesn't execute correctly. Could someone help me understand the problem?
Thank you in advance