01-22-2019, 12:25 PM
So if you want to show 6 months from the date in the db it's
$date = date('Y-m-d', strtotime("+6 months", strtotime($user->data()->validity));
dump($date);
If you want to add the time before you put it in the db, it's...
$date = date('Y-m-d', strtotime("+6 months", strtotime(date("Y-m-d"))));
$db->update('users',$user->data()->id,['validity'=>$date]);
$date = date('Y-m-d', strtotime("+6 months", strtotime($user->data()->validity));
dump($date);
If you want to add the time before you put it in the db, it's...
$date = date('Y-m-d', strtotime("+6 months", strtotime(date("Y-m-d"))));
$db->update('users',$user->data()->id,['validity'=>$date]);