/** * Optimization constructor. * @param \Illuminate\Contracts\Foundation\Application $app * @param \Notadd\Setting\Factory $setting * @param \Illuminate\View\Factory $view */ public function __construct(Application $app, SettingFactory $setting, Factory $view) { $this->app = $app; $this->view = $view; $this->code = new Collection(); $this->meta = new Meta(); $this->setting = $setting; $this->code->put('{sitename}', $this->setting->get('seo.title', 'Notadd CMS')); }
/** * @return bool */ public function isDefault() { if ($this->setting->get('site.theme') === $this->alias) { return true; } return false; }
/** * @return void */ public function fire() { if (!$this->isDataSetted) { $this->setDataFromConsoling(); } $this->config->set('database', ['fetch' => PDO::FETCH_CLASS, 'default' => 'mysql', 'connections' => ['mysql' => ['driver' => 'mysql', 'host' => $this->data->get('host'), 'database' => $this->data->get('database'), 'username' => $this->data->get('username'), 'password' => $this->data->get('password'), 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => $this->data->get('prefix'), 'strict' => true]], 'migrations' => 'migrations', 'redis' => []]); $this->call('migrate'); $this->setting->set('site.title', $this->data->get('title')); $this->setting->set('seo.title', $this->data->get('title')); $this->createAdministrationUser(); $this->writingConfiguration(); $this->comment('Application Installed!'); }