Esempio n. 1
0
 /**
  * @param $key
  * @param $value
  * @return bool
  */
 public function set($key, $value)
 {
     $setting = Setting::whereKey($key)->first();
     if (!is_object($setting)) {
         $setting = new Setting();
         $setting->key = $key;
     }
     $setting->value = $value;
     $setting->save();
     if ($this->application->isInstalled()) {
         $this->cache->forget($this->cache_key);
     }
     return true;
 }
Esempio n. 2
0
 /**
  * Bootstrap the given application.
  *
  * @param \Illuminate\Contracts\Foundation\Application|\Notadd\Foundation\Application $application
  *
  * @return void
  */
 public function bootstrap(Application $application)
 {
     if ($application->isInstalled()) {
         if ($application->routesAreCached()) {
             $application->booted(function () use($application) {
                 require $application->getCachedRoutesPath();
             });
         } else {
             $application->make('events')->fire(new RouteRegister($application, $application['router']));
             $application->booted(function () use($application) {
                 $application['router']->getRoutes()->refreshNameLookups();
             });
         }
     }
 }
Esempio n. 3
0
 /**
  * Bootstrap the given application.
  *
  * @param \Illuminate\Contracts\Foundation\Application|\Notadd\Foundation\Application $application
  *
  * @return void
  */
 public function bootstrap(Application $application)
 {
     if ($application->isInstalled()) {
         $config = $application->make(ConfigRepository::class);
         $setting = $application->make(SettingsRepository::class);
         date_default_timezone_set($setting->get('setting.timezone', $config['app.timezone']));
         $config->set('app.debug', $setting->get('setting.debug', true));
         $config->set('mail.driver', $setting->get('mail.driver', 'smtp'));
         $config->set('mail.host', $setting->get('mail.host'));
         $config->set('mail.port', $setting->get('mail.port'));
         $config->set('mail.from.address', $setting->get('mail.from'));
         $config->set('mail.from.name', $setting->get('site.title', 'Notadd'));
         $config->set('mail.encryption', $setting->get('mail.encryption'));
         $config->set('mail.username', $setting->get('mail.username'));
         $config->set('mail.password', $setting->get('mail.password'));
     }
 }