FEATURE: use even more route model binding
This commit is contained in:
@@ -7,16 +7,21 @@ use App\Models\Templates\TemplatePath;
|
||||
|
||||
class TemplateOverview extends Controller
|
||||
{
|
||||
public function getPath($path)
|
||||
/**
|
||||
* Display overview of all templates in given path
|
||||
*
|
||||
* @param TemplatePath $templatePath
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function getPath(TemplatePath $templatePath)
|
||||
{
|
||||
$path = TemplatePath::findOrFail($path);
|
||||
|
||||
return view('admin.templates.list', [
|
||||
'directory' => $path,
|
||||
'isWritable' => is_writable(base_path($path->path)),
|
||||
'templates' => $path->templates()
|
||||
'directory' => $templatePath,
|
||||
'isWritable' => is_writable(base_path($templatePath->path)),
|
||||
'templates' => $templatePath->templates()
|
||||
->get(),
|
||||
'subdirectories' => $path->subdirectories()
|
||||
'subdirectories' => $templatePath->subdirectories()
|
||||
->get()
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user