diff --git a/app/Http/Requests/Company/StoreCompanyRequest.php b/app/Http/Requests/Company/StoreCompanyRequest.php index 34ace25359..5d9c192cf9 100644 --- a/app/Http/Requests/Company/StoreCompanyRequest.php +++ b/app/Http/Requests/Company/StoreCompanyRequest.php @@ -55,12 +55,17 @@ class StoreCompanyRequest extends Request { $input = $this->all(); + if(strlen($input['portal_domain']) > 1) + $input['portal_domain'] = str_replace("http:", "https:", $input['portal_domain']); + if (array_key_exists('google_analytics_url', $input)) { $input['google_analytics_key'] = $input['google_analytics_url']; } $company_settings = CompanySettings::defaults(); + //@todo this code doesn't make sense as we never return $company_settings anywhere + //@deprecated??? if (array_key_exists('settings', $input) && ! empty($input['settings'])) { foreach ($input['settings'] as $key => $value) { $company_settings->{$key} = $value; diff --git a/app/Http/Requests/Company/UpdateCompanyRequest.php b/app/Http/Requests/Company/UpdateCompanyRequest.php index 3dbb69f93d..f086d39b99 100644 --- a/app/Http/Requests/Company/UpdateCompanyRequest.php +++ b/app/Http/Requests/Company/UpdateCompanyRequest.php @@ -59,7 +59,10 @@ class UpdateCompanyRequest extends Request protected function prepareForValidation() { $input = $this->all(); -// nlog($input); + + if(strlen($input['portal_domain']) > 1) + $input['portal_domain'] = str_replace("http:", "https:", $input['portal_domain']); + if (array_key_exists('settings', $input)) { $input['settings'] = $this->filterSaveableSettings($input['settings']); } diff --git a/app/Listeners/Account/CreateAccountActivity.php b/app/Listeners/Account/CreateAccountActivity.php index 465aa07884..119cab05f3 100644 --- a/app/Listeners/Account/CreateAccountActivity.php +++ b/app/Listeners/Account/CreateAccountActivity.php @@ -42,7 +42,7 @@ class CreateAccountActivity implements ShouldQueue if(Ninja::isHosted()) { $nmo = new NinjaMailerObject; - $nmo->mailable = new Modules\Admin\Mail\Welcome($event->user); + $nmo->mailable = new \Modules\Admin\Mail\Welcome($event->user); $nmo->company = $event->company; $nmo->settings = $event->company->settings; $nmo->to_user = $event->user; diff --git a/app/Observers/CompanyObserver.php b/app/Observers/CompanyObserver.php index 0329dbeddb..2859adfc0e 100644 --- a/app/Observers/CompanyObserver.php +++ b/app/Observers/CompanyObserver.php @@ -44,7 +44,7 @@ class CompanyObserver nlog($company->getOriginal('portal_domain')); //fire event to build new custom portal domain - Modules\Admin\Jobs\Domain\CustomDomain::dispatch($company->getOriginal('portal_domain'), $company); + \Modules\Admin\Jobs\Domain\CustomDomain::dispatch($company->getOriginal('portal_domain'), $company); } }