FEATURE: make own page for template overview

This commit is contained in:
Michal Kváček
2017-09-15 13:32:09 +02:00
parent 4d68156a73
commit ba55702585
14 changed files with 151 additions and 100 deletions
@@ -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))
]);
}
}