Support renewing white label license early

This commit is contained in:
Hillel Coren 2016-12-28 20:40:25 +02:00
parent d8cab55786
commit d6b0827eac

View File

@ -149,7 +149,8 @@ class StartupCheck
$company = Auth::user()->account->company;
$company->plan_term = PLAN_TERM_YEARLY;
$company->plan_paid = $data;
$company->plan_expires = date_create($data)->modify('+1 year')->format('Y-m-d');
$date = max(date_create($data), date_create($company->plan_expires));
$company->plan_expires = $date->modify('+1 year')->format('Y-m-d');
$company->plan = PLAN_WHITE_LABEL;
$company->save();