Skip to content

Commit 2a674b5

Browse files
authored
Update SocialCommand.php
1 parent a440094 commit 2a674b5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Commands/SocialCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ public function handle(): int
2929

3030
$this->installDependency();
3131
$this->addServicesConfig();
32-
$this->addEnvs();
32+
$this->addEnvs('.env');
33+
$this->addEnvs('.env.example');
3334
$this->copyView();
3435

3536
$this->info('Social Authentication installed correctly.');
@@ -88,22 +89,21 @@ protected function addServicesConfig(): void
8889
/**
8990
* Add the needed environment variables.
9091
*/
91-
protected function addEnvs(): void
92+
protected function addEnvs(string $envFile): void
9293
{
9394
if ($this->chosenDriver === self::DRIVER_OTHER) {
9495
return;
9596
}
9697

97-
$envPath = getcwd() . '/.env';
98+
$envPath = getcwd() . '/' . $envFile;
9899
$envFile = file_get_contents($envPath);
99100

100101
// Do not add the entry if already exists
101102
if (str_contains($envFile, 'MAILCARRIER_SOCIAL_AUTH_DRIVER=')) {
102103
return;
103104
}
104105

105-
$envFile .= PHP_EOL .
106-
'MAILCARRIER_SOCIAL_AUTH_DRIVER=' . strtolower($this->chosenDriver) .
106+
$envFile .= 'MAILCARRIER_SOCIAL_AUTH_DRIVER=' . strtolower($this->chosenDriver) .
107107
PHP_EOL .
108108
$this->buildEnvs();
109109

0 commit comments

Comments
 (0)