laravel get data in view table if due date having 3 day 0 0

Last updated on Apr 11, 2022 12:55 AM in Script/CMS » Laravel
Posted ByWehostClub

Please try this one:

//if your payment date is 15-4-2022 then you have to add 4 days in carbon objects.
 $dueDate = Carbon::now()->addDays(4);
 Payment::select( 'next_due_date')->whereDate('next_due_date', $dueDate)->get();


 Payment::select( 'next_due_date')->whereDate('next_due_date', date('Y-m-d', strtotime("4 days")))->get();

** The time is base on America/New_York timezone