protected function loadData() { if (!($theme = Theme::getActiveTheme())) { throw new ApplicationException(Lang::get('cms::lang.theme.not_found_name', ['name' => Theme::getActiveThemeCode()])); } $this->vars['theme'] = $theme; $this->vars['inMaintenance'] = MaintenanceSetting::get('is_enabled'); }
/** * Boot all of the bootable traits on the model. * @return void */ protected static function bootDefaultTheme() { $resolver = static::getDatasourceResolver(); if ($resolver->getDefaultDatasource()) { return; } $defaultTheme = App::runningInBackend() ? Theme::getEditThemeCode() : Theme::getActiveThemeCode(); Theme::load($defaultTheme); $resolver->setDefaultDatasource($defaultTheme); }