Reputation: 136
I Am making a query where I need to find all the results for reminder that are greater than 24h in that database.
My query looks like this but its wrong I believe
$reminder = Reminder::where('reminder_date','<', Carbon::now()->addHours(24))
->get();
Using Laravel / Carbon
Upvotes: 2
Views: 2262
Reputation: 3901
It looks like you might be using the wrong operator. <
(Less than) should be swapped for >
(Greater than):
$reminder = Reminder::where('reminder_date','>', Carbon::now()->addHours(24))
->get();
Upvotes: 3