FEATURE: make own page for template overview
This commit is contained in:
@@ -207,6 +207,7 @@ class TemplateRegistrator
|
||||
protected function registerTemplates($path, $templatePathId)
|
||||
{
|
||||
$templates = File::files($path);
|
||||
$registeredTemplates = Templates::getWithTranslations();
|
||||
|
||||
foreach ($templates as $template) {
|
||||
|
||||
@@ -217,7 +218,6 @@ class TemplateRegistrator
|
||||
|
||||
// get all templates and template name (path/to/template.blade.php -> path.to.template)
|
||||
$templateName = $this->getTemplateName($template);
|
||||
$registeredTemplates = Templates::getWithTranslations();
|
||||
|
||||
if (!in_array($templateName, $registeredTemplates)) {
|
||||
$params = [
|
||||
@@ -316,4 +316,14 @@ class TemplateRegistrator
|
||||
|
||||
return $this->namespace . trim($templateName, '.');
|
||||
}
|
||||
|
||||
public function deleteNonExistingPaths()
|
||||
{
|
||||
$paths = TemplatePath::all();
|
||||
|
||||
foreach ($paths as $path) {
|
||||
if (!is_dir(base_path($path->path)))
|
||||
\File::deleteDirectory($path->path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user