File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ class SailEnvCommand extends InstallCommand
1111 *
1212 * @var string
1313 */
14- protected $ signature = 'sail:env ' ;
14+ protected $ signature = 'sail:env
15+ {--O|overwrite : Whether to overwrite the .env file if it exists} ' ;
1516
1617 /**
1718 * The console command description.
@@ -44,6 +45,11 @@ class SailEnvCommand extends InstallCommand
4445 */
4546 public function handle ()
4647 {
48+ if ($ this ->option ('overwrite-env ' )) {
49+ $ this ->comment ('Overwriting environment variables ' );
50+ copy ($ this ->laravel ->basePath ('.env.example ' ), $ this ->laravel ->basePath ('.env ' ));
51+ }
52+
4753 // Create .env file if it doesn't exist
4854 if (! file_exists ($ this ->laravel ->basePath ('.env ' ))) {
4955 $ this ->warn ('No .env file found. Creating .env file from .env.example ' );
You can’t perform that action at this time.
0 commit comments