Skip to content

Commit

Permalink
Allow nested markdown files for mailables (#41366)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahinkle authored Mar 7, 2022
1 parent 9b84e6d commit b7625b3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Illuminate/Foundation/Console/MailMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ protected function getView()
$view = $this->option('markdown');

if (! $view) {
$view = 'mail.'.Str::kebab(class_basename($this->argument('name')));
$name = str_replace('\\', '/', $this->argument('name'));

$view = 'mail.'.collect(explode('/', $name))
->map(fn ($part) => Str::kebab($part))
->implode('.');
}

return $view;
Expand Down

0 comments on commit b7625b3

Please sign in to comment.