Level 50
You can use normal comparators to compare dates with eloquent:
Model::whereDate('date', '<', today())->get();
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi, imagine I have a model in my database wich has a filed "date", this file is a Carbon timestamp.
Now, I want to retrieve all instances of that model where date field has not yet come, that is, where the date field is prior to Carbon::now() timestamp.
Any suggestions?
You can use normal comparators to compare dates with eloquent:
Model::whereDate('date', '<', today())->get();
Please or to participate in this conversation.