Skip to content

Commit 2dbdac5

Browse files
committed
Merge branch 'component-make-patch' into 8.x
2 parents 26f62b1 + 0ce75e0 commit 2dbdac5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Illuminate/Foundation/Console/ComponentMakeCommand.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,21 @@ public function handle()
5454
protected function writeView()
5555
{
5656
$path = $this->viewPath(
57-
str_replace('.', '/', 'components.'.$this->getView())
57+
str_replace('.', '/', 'components.'.$this->getView()).'.blade.php'
5858
);
5959

6060
if (! $this->files->isDirectory(dirname($path))) {
6161
$this->files->makeDirectory(dirname($path), 0777, true, true);
6262
}
6363

64+
if ($this->files->exists($path) && ! $this->option('force')) {
65+
$this->error('View already exists!');
66+
67+
return;
68+
}
69+
6470
file_put_contents(
65-
$path.'.blade.php',
71+
$path,
6672
'<div>
6773
<!-- '.Inspiring::quote().' -->
6874
</div>'

0 commit comments

Comments
 (0)