Skip to content

Commit 4f22912

Browse files
fix(views): Issue with mail views
fix #18
1 parent f6f7ae1 commit 4f22912

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/Theme.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,19 +390,27 @@ protected function registerViews()
390390
$directories = scandir($vendorViewsPath);
391391
foreach ($directories as $namespace) {
392392
if ($namespace != '.' && $namespace != '..') {
393-
$path = "{$vendorViewsPath}/{$namespace}";
394-
395393
if (!empty(Config::get('view.paths')) && is_array(Config::get('view.paths'))) {
396394
foreach (Config::get('view.paths') as $viewPath) {
397395
if (is_dir($appPath = $viewPath . '/vendor/' . $namespace)) {
398396
View::prependNamespace($namespace, $appPath);
399397
}
400398
}
401399
}
402-
403-
View::prependNamespace($namespace, $path);
404400
}
405401
}
406402
}
403+
404+
// Update config mail.markdown.paths to work with mail views
405+
$mailViewsPath = $this->getPath('resources/views/vendor/mail');
406+
if (File::exists($vendorViewsPath) && is_dir($mailViewsPath)) {
407+
if (is_array(Config::get('mail.markdown.paths'))) {
408+
Config::set('mail.markdown.paths', array_merge([
409+
$mailViewsPath
410+
], Config::get('mail.markdown.paths')));
411+
} else {
412+
Config::set('mail.markdown.paths', $mailViewsPath);
413+
}
414+
}
407415
}
408416
}

0 commit comments

Comments
 (0)