Level 51
Figured it out by doing:
Model::where('deadline','>=', date('Y-m-d'))->get();
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a field in my database called "deadline" which is has DATE 2015-01-01 format.
I want to use Eloquent to say that if the deadline field does not match today's date and is in the past then don't show the record, otherwise if it's a future date then show the record.
How can I achieve this?
Figured it out by doing:
Model::where('deadline','>=', date('Y-m-d'))->get();
Please or to participate in this conversation.