I am trying to fetch the current date and add 7 to it to calculate date of weekly installments for a project. while doing so i encountered a problem:-
date_add() expects parameter 1 to be DateTime, string given
The line causing me this error is
$loan->nextpremiumdate=date_add(date("Y-m-d h:i:sa"),date_interval_create_from_date_string("1 days"));
i am using laravel framework. and nextpremiumdate is column in my loan table.