vendredi 20 septembre 2019

how can i increment 6 months selecting from database to_date field?

I'm making my project,and want to increment date from fetching to_date filed with 6 months if last to_date is gone then add more 6 months and so on what can i do for this? $abc=(Session::get('email')); $email= $request->input('email'); if (Maintenance::where('email', '=', $email)) { $users=Carbon::create(2019,0,30)->addMonths(6)->toDatestring();
if (Maintenance::where('maintenance_status', '=', 'PAID')->orderBy('todate','DESC')) { $check = Maintenance::select('to_date')->where('maintenance_status', '=', 'PAID')->orderBy('to_date','DESC')->get(); // $users= Carbon($check[0])->addmoths(6); $users = Carbon::addMonths(6)->toDatestring();

i expect the output of 30-06-2019,30-12-2019 and so on but the actual output is only increment one time using Carbon and i want to increment fetching from database date



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire