Skip to content

Commit faf3842

Browse files
authored
fix mail tags silently failing (#44550)
1 parent 551151d commit faf3842

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Illuminate/View/Compilers/ComponentTagCompiler.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,12 @@ protected function componentString(string $component, array $attributes)
236236
// component and pass the component as a view parameter to the data so it
237237
// can be accessed within the component and we can render out the view.
238238
if (! class_exists($class)) {
239+
$view = Str::startsWith($component, 'mail::')
240+
? "\$__env->getContainer()->make(Illuminate\\View\\Factory::class)->make('{$component}')"
241+
: "'$class'";
242+
239243
$parameters = [
240-
'view' => "'$class'",
244+
'view' => $view,
241245
'data' => '['.$this->attributesToString($data->all(), $escapeBound = false).']',
242246
];
243247

0 commit comments

Comments
 (0)