Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/Console/SailEnvCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ class SailEnvCommand extends InstallCommand
*
* @var string
*/
protected $signature = 'sail:env';
protected $signature = 'sail:env
{--O|overwrite : Whether to overwrite the .env file if it exists}';

/**
* The console command description.
Expand Down Expand Up @@ -44,6 +45,11 @@ class SailEnvCommand extends InstallCommand
*/
public function handle()
{
if ($this->option('overwrite-env')) {
$this->comment('Overwriting environment variables');
copy($this->laravel->basePath('.env.example'), $this->laravel->basePath('.env'));
}

// Create .env file if it doesn't exist
if (! file_exists($this->laravel->basePath('.env'))) {
$this->warn('No .env file found. Creating .env file from .env.example');
Expand Down