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();
}
}