Ejemplo n.º 1
0
 public function getAdminHome()
 {
     $totalPosts = Post::count();
     $totalPages = Page::count();
     $viewData = ['pageTitle' => 'Dashboard', 'totalPosts' => $totalPosts, 'totalPages' => $totalPages];
     return view('admin::index', $viewData);
 }
Ejemplo n.º 2
0
 public function getPageBySlug($slug)
 {
     $page = Page::where('slug', '=', $slug)->where('is_published', '=', true)->first();
     if (!$page) {
         abort(404);
     }
     $viewData = ['pageTitle' => $page->title, 'page' => $page];
     if (current_theme_exists() && theme_view_exists(current_theme(), 'pages.show')) {
         return response(current_theme_view('pages.show', $viewData));
     }
     return view('pages.show', $viewData);
 }