]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/PageTemplateController.php
Update settings.php
[bookstack] / app / Http / Controllers / PageTemplateController.php
index 05943351a06f1b47a7ba36e6052eabd215e73094..eaa1a8ae26ae18f28473c6796062dfb5065dba97 100644 (file)
@@ -11,8 +11,7 @@ class PageTemplateController extends Controller
     protected $pageRepo;
 
     /**
-     * PageTemplateController constructor.
-     * @param $pageRepo
+     * PageTemplateController constructor
      */
     public function __construct(PageRepo $pageRepo)
     {
@@ -22,14 +21,12 @@ class PageTemplateController extends Controller
 
     /**
      * Fetch a list of templates from the system.
-     * @param Request $request
-     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
      */
     public function list(Request $request)
     {
         $page = $request->get('page', 1);
         $search = $request->get('search', '');
-        $templates = $this->pageRepo->getPageTemplates(10, $page, $search);
+        $templates = $this->pageRepo->getTemplates(10, $page, $search);
 
         if ($search) {
             $templates->appends(['search' => $search]);
@@ -42,13 +39,11 @@ class PageTemplateController extends Controller
 
     /**
      * Get the content of a template.
-     * @param $templateId
-     * @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response
      * @throws NotFoundException
      */
-    public function get($templateId)
+    public function get(int $templateId)
     {
-        $page = $this->pageRepo->getById('page', $templateId);
+        $page = $this->pageRepo->getById($templateId);
 
         if (!$page->template) {
             throw new NotFoundException();
@@ -59,5 +54,4 @@ class PageTemplateController extends Controller
             'markdown' => $page->markdown,
         ]);
     }
-
 }