29 lines
847 B
PHP
29 lines
847 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Admin\Templates;
|
|
|
|
use App\Http\Controllers\Admin\Controller;
|
|
use App\Models\Templates\TemplatePath;
|
|
|
|
class TemplateOverview extends Controller
|
|
{
|
|
/**
|
|
* Display overview of all templates in given path
|
|
*
|
|
* @param TemplatePath $templatePath
|
|
*
|
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
|
*/
|
|
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()
|
|
]);
|
|
}
|
|
}
|