Skip to content

Commit

Permalink
Add default config values to the installer controller so the blade vi…
Browse files Browse the repository at this point in the history
…ew can access them
  • Loading branch information
johannac committed Jan 19, 2023
1 parent 2785449 commit 7d712be
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions app/Http/Controllers/InstallerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,36 @@ public function showInstaller()

protected function constructInstallerData(): void
{
$this->addDefaultConfig();
$this->addWritablePaths();
$this->addPHPExtensions();
$this->addPHPOptionalExtensions();
}

/**
* Adds default config values for the view blade to use
*/
protected function addDefaultConfig(): void
{
$database_default = Config::get('database.default');
$this->data['default_config'] = [
'application_url' => Config::get('app.url'),
'database_type' => $database_default,
'database_host' => Config::get('database.connections.' . $database_default . '.host'),
'database_name' => Config::get('database.connections.' . $database_default . '.database'),
'database_username' => Config::get('database.connections.' . $database_default . '.username'),
'database_password' => Config::get('database.connections.' . $database_default . '.password'),
'mail_from_address' => Config::get('mail.from.address'),
'mail_from_name' => Config::get('mail.from.name'),
'mail_driver' => Config::get('mail.driver'),
'mail_port' => Config::get('mail.port'),
'mail_encryption' => Config::get('mail.encryption'),
'mail_host' => Config::get('mail.host'),
'mail_username' => Config::get('mail.username'),
'mail_password' => Config::get('mail.password')
];
}

/**
* Adds to the checks the paths that should be writable
*/
Expand Down

0 comments on commit 7d712be

Please sign in to comment.