Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Gabotronix's avatar

get users created more than three months ago

in my laravel app I want to get all records of users where "created_at" timestamp is older than three months from current date, is it possible to achieve this with Eloquent query builder?

0 likes
1 reply
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

Something like

->whereDate('created_at', '<', now()->subMonths(3))

Please or to participate in this conversation.