Something like
Record::where('created_at', '>=', Carbon::now()->subDay(7))->get();
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am using Laravel 8
Writing a query, and want to display today's record(Dt.: 17/08/2022) for at least one week which means(at least for 7 days (Dt.: 24/08/2022)) using carbon.
After one week which means on 25th august records should be excluded from listing.
What should I do to archive this result? any help would be great!
Thank you!
Please or to participate in this conversation.