Skip to content

Commit fa63f52

Browse files
committed
try to copy .env.example if .env does not exists
1 parent a2f1dc0 commit fa63f52

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Console/Commands/SetEnvCommand.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ public function __construct()
3939
*/
4040
public function handle()
4141
{
42+
43+
if(!file_exists(base_path() . '/.env'))
44+
{
45+
copy('.env.example', '.env');
46+
}
47+
4248
$this->info('Installing default .env vars.');
4349

4450
if($this->option('file') !== null)
@@ -70,6 +76,7 @@ public function handle()
7076
exit();
7177
}
7278

79+
7380
// Load the .env
7481
try {
7582
$app_env = DotenvEditor::load();

0 commit comments

Comments
 (0)