Find The Next 7 Date Data In Laravel Eloquent

[Solved] Find The Next 7 Date Data In Laravel Eloquent | Php - Code Explorer | yomemimo.com
Question : find the next 7 date data in laravel eloquent

Answered by : sujay-patel

$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);

Source : https://laracasts.com/discuss/channels/laravel/how-to-get-next-seven-day-data-in-laravel?page=0 | Last Update : Fri, 04 Dec 20

Answers related to find the next 7 date data in laravel eloquent

Code Explorer Popular Question For Php