FEATURE: make own page for template overview
This commit is contained in:
@@ -7,6 +7,16 @@ use App\Models\Templates\TemplatePath;
|
||||
|
||||
class TemplateOverview extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
|
||||
$templatePaths = TemplatePath::with('subdirectories')
|
||||
->whereNull('parent_id')
|
||||
->get();
|
||||
|
||||
return view('admin.templates.index', compact('templatePaths'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display overview of all templates in given path
|
||||
*
|
||||
@@ -17,12 +27,8 @@ class TemplateOverview extends Controller
|
||||
public function getPath(TemplatePath $templatePath)
|
||||
{
|
||||
return view('admin.templates.list', [
|
||||
'directory' => $templatePath,
|
||||
'isWritable' => is_writable(base_path($templatePath->path)),
|
||||
'templates' => $templatePath->templates()
|
||||
->get(),
|
||||
'subdirectories' => $templatePath->subdirectories()
|
||||
->get()
|
||||
'directory' => $templatePath,
|
||||
'isWritable' => is_writable(base_path($templatePath->path))
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user