Level 122
You want to find invoices that are due in the next 7 days?
Why would any created_at date be in the future? Please explain further.
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi Guys,
I want to get the next seven data in laravel using carbon to send a reminder. Actually I want to do an opposite in below method.
$anchor = Carbon::today()->subDay(7);
$users = Invoices::where('created_at', '>=', $date)->get();
dd($users);
$startDate = Carbon::today();
$endDate = Carbon::today()->addDays(7);
$invoices = Invoice::whereBetween('due_date', [$startDate, $endDate])->get();
// Replace "due_date" with your actual column name
// Check your model names, they should be singular and not plural.
dd($invoices);
Please or to participate in this conversation.