diff --git a/src/Illuminate/Foundation/Console/ComponentMakeCommand.php b/src/Illuminate/Foundation/Console/ComponentMakeCommand.php index 183206ee5d86..709c53609175 100644 --- a/src/Illuminate/Foundation/Console/ComponentMakeCommand.php +++ b/src/Illuminate/Foundation/Console/ComponentMakeCommand.php @@ -43,11 +43,7 @@ class ComponentMakeCommand extends GeneratorCommand public function handle() { if ($this->option('view')) { - $this->writeView(function () { - $this->components->info($this->type.' created successfully.'); - }); - - return; + return $this->writeView(); } if (parent::handle() === false && ! $this->option('force')) { @@ -62,10 +58,9 @@ public function handle() /** * Write the view for the component. * - * @param callable|null $onSuccess * @return void */ - protected function writeView($onSuccess = null) + protected function writeView() { $path = $this->viewPath( str_replace('.', '/', 'components.'.$this->getView()).'.blade.php' @@ -88,9 +83,7 @@ protected function writeView($onSuccess = null) ' ); - if ($onSuccess) { - $onSuccess(); - } + $this->components->info(sprintf('%s [%s] created successfully.', 'View', $path)); } /** diff --git a/src/Illuminate/Foundation/Console/MailMakeCommand.php b/src/Illuminate/Foundation/Console/MailMakeCommand.php index 31ef3c394be5..2941dccd9375 100644 --- a/src/Illuminate/Foundation/Console/MailMakeCommand.php +++ b/src/Illuminate/Foundation/Console/MailMakeCommand.php @@ -69,6 +69,8 @@ protected function writeMarkdownTemplate() $this->files->ensureDirectoryExists(dirname($path)); $this->files->put($path, file_get_contents(__DIR__.'/stubs/markdown.stub')); + + $this->components->info(sprintf('%s [%s] created successfully.', 'Markdown view', $path)); } /** @@ -91,6 +93,8 @@ protected function writeView() ); $this->files->put($path, $stub); + + $this->components->info(sprintf('%s [%s] created successfully.', 'View', $path)); } /** diff --git a/src/Illuminate/Foundation/Console/NotificationMakeCommand.php b/src/Illuminate/Foundation/Console/NotificationMakeCommand.php index 83b9663d7102..d9352655f973 100644 --- a/src/Illuminate/Foundation/Console/NotificationMakeCommand.php +++ b/src/Illuminate/Foundation/Console/NotificationMakeCommand.php @@ -65,6 +65,8 @@ protected function writeMarkdownTemplate() } $this->files->put($path, file_get_contents(__DIR__.'/stubs/markdown.stub')); + + $this->components->info(sprintf('%s [%s] created successfully.', 'Markdown', $path)); } /** diff --git a/src/Illuminate/Foundation/Console/ViewMakeCommand.php b/src/Illuminate/Foundation/Console/ViewMakeCommand.php index 4708f7d9fa62..3f8e4da6a639 100644 --- a/src/Illuminate/Foundation/Console/ViewMakeCommand.php +++ b/src/Illuminate/Foundation/Console/ViewMakeCommand.php @@ -142,7 +142,11 @@ protected function handleTestCreation($path): bool File::ensureDirectoryExists(dirname($this->getTestPath()), 0755, true); - return File::put($this->getTestPath(), $contents); + $result = File::put($path = $this->getTestPath(), $contents); + + $this->components->info(sprintf('%s [%s] created successfully.', 'Test', $path)); + + return $result !== false; } /**