Reputation: 915
The following is the required date format :
$sel_date = date('Y-m-d');
But the created_at field has the full date/time format :
2019-10-15 16:14:18
I need to add to the query only the date by omitting the time, as below :
->where('created_at', $sel_date )
Upvotes: 0
Views: 75
Reputation: 2012
Try this:
->whereDate('created_at', $sel_date)
Some documentation about additional where
queries here.
Upvotes: 4
Reputation: 83
you can use date()
function of mysql.
->where('date(created_at)', $sel_date )
Upvotes: 0