Devise\Support\Console\DeviseInstallCommand::changeDatabaseConfigFile PHP Метод

changeDatabaseConfigFile() публичный Метод

Changes the default out of the box Laravel database config to include other env() settings that we will use in Devise such as 'default' and we also update the sqlite driver stuff
public changeDatabaseConfigFile ( ) : void
Результат void
    public function changeDatabaseConfigFile()
    {
        $databaseConfigFile = $this->basePath . '/config/database.php';
        $contents = file_get_contents($databaseConfigFile);
        $driver = $this->Config->get('database.default');
        $modified = str_replace("'default' => '{$driver}',", "'default' => env('DB_DEFAULT', 'mysql'),", $contents);
        if ($contents !== $modified) {
            file_put_contents($databaseConfigFile, $modified);
        }
    }