/**
  * Execute the console command.
  *
  * @return void
  */
 public function handle()
 {
     parent::fire();
     try {
         if (cmsinstalled()) {
             throw new \Exception('The CMS is already installed!');
         }
         $success = $this->r_installer->testDBConnection($this->argument('db-host'), $this->argument('db-name'), $this->argument('db-username'), $this->argument('db-password'));
         if ($success) {
             $this->r_installer->generateConfigs($this->argument('site-name'), $this->argument('site-description'), $this->argument('site-url'), $this->argument('db-host'), $this->argument('db-name'), $this->argument('db-username'), $this->argument('db-password'), $this->argument('user-first-name'), $this->argument('user-last-name'), $this->argument('user-email'));
             $this->call('cache:clear');
             $this->r_installer->migrate(['APP_SITE_NAME' => $this->argument('site-name'), 'APP_URL' => $this->argument('site-url')], ['--force' => true, '--database' => 'installer'], ['--force' => true, '--database' => 'installer']);
             $password = Str::random(Settings::get('installer.password_length'));
             $this->r_installer->addUserAdmin(['civility' => $this->argument('user-civility'), 'first_name' => $this->argument('user-first-name'), 'last_name' => $this->argument('user-last-name'), 'email' => $this->argument('user-email'), 'password' => $password]);
             $this->r_installer->set_env_as_production();
             $this->line(sprintf(trans('installer::installer.command_line_show_password'), $this->argument('user-email'), $password));
             $this->line(trans('installer::installer.command_line_remember_change_password'));
         } else {
             $this->error(trans('installer::installer.error:db_connection'));
         }
     } catch (InvalidArgumentException $e) {
         $this->error($e->getMessage());
     } catch (\Exception $e) {
         $this->error($e->getMessage());
     }
 }
 /**
  * Step 2
  *
  * Run migration based on .env.installer
  *
  * @return Redirect
  */
 public function runMigration(Request $request)
 {
     // Retrieve data from the session
     $session_installer = $request->session()->get('installer_user_admin');
     $this->r_installer->migrate($session_installer);
     return redirect('installer/initialisation');
 }