Skip to content

Commit b7625b3

Browse files
authored
Allow nested markdown files for mailables (#41366)
1 parent 9b84e6d commit b7625b3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Illuminate/Foundation/Console/MailMakeCommand.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ protected function getView()
102102
$view = $this->option('markdown');
103103

104104
if (! $view) {
105-
$view = 'mail.'.Str::kebab(class_basename($this->argument('name')));
105+
$name = str_replace('\\', '/', $this->argument('name'));
106+
107+
$view = 'mail.'.collect(explode('/', $name))
108+
->map(fn ($part) => Str::kebab($part))
109+
->implode('.');
106110
}
107111

108112
return $view;

0 commit comments

Comments
 (0)