prepareConnection() public static method

Try to connect to the database with given config.
public static prepareConnection ( array $config = null ) : mysqli
$config array
return mysqli
 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot(Request $request)
 {
     View::addExtension('tpl', 'blade');
     // check dotenv
     if (!file_exists(base_path('.env'))) {
         throw new PrettyPageException(trans('setup.file.no-dot-env'), -1);
     }
     try {
         // check database config
         Database::prepareConnection();
     } catch (\Exception $e) {
         throw new PrettyPageException(trans('setup.database.connection-error', ['msg' => $e->getMessage()]), $e->getCode());
     }
     // skip the installation check when setup or under CLI
     if (!$request->is('setup') && !$request->is('setup/*') && PHP_SAPI != "cli") {
         $this->checkInstallation();
     }
 }