Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.4] Prevent overwrite existing views running make:auth #18319

Merged
merged 2 commits into from
Mar 14, 2017
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
10 changes: 9 additions & 1 deletion src/Illuminate/Auth/Console/MakeAuthCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ class MakeAuthCommand extends Command
*
* @var string
*/
protected $signature = 'make:auth {--views : Only scaffold the authentication views}';
protected $signature = 'make:auth
{--views : Only scaffold the authentication views}
{--force : Overwrite existing views by default}';

/**
* The console command description.
Expand Down Expand Up @@ -88,6 +90,12 @@ protected function createDirectories()
protected function exportViews()
{
foreach ($this->views as $key => $value) {
if (! $this->option('force') && file_exists(resource_path('views/'.$value))) {
if (! $this->confirm('The view '.$value.' already exists, Do you wish overwrite it?')) {
continue;
}
}

copy(
__DIR__.'/stubs/make/views/'.$key,
resource_path('views/'.$value)
Expand Down