diff --git a/src/Illuminate/Foundation/Console/NotificationMakeCommand.php b/src/Illuminate/Foundation/Console/NotificationMakeCommand.php index 2cc6a4d96e1..d6105af9192 100644 --- a/src/Illuminate/Foundation/Console/NotificationMakeCommand.php +++ b/src/Illuminate/Foundation/Console/NotificationMakeCommand.php @@ -4,6 +4,7 @@ use Illuminate\Console\Concerns\CreatesMatchingTest; use Illuminate\Console\GeneratorCommand; +use Illuminate\Support\Str; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -143,7 +144,13 @@ protected function afterPromptingForMissingArguments(InputInterface $input, Outp $wantsMarkdownView = confirm('Would you like to create a markdown view?'); if ($wantsMarkdownView) { - $markdownView = text('What should the markdown view be named?', 'E.g. invoice-paid'); + $defaultMarkdownView = collect(explode('/', str_replace('\\', '/', $this->argument('name')))) + ->map(fn ($path) => Str::kebab($path)) + ->prepend('mail') + ->implode('.'); + + $markdownView = text('What should the markdown view be named?', default: $defaultMarkdownView); + $input->setOption('markdown', $markdownView); } }