/** * Show a page * * @return mixed */ public function showPage() { $slug = Request::segment(1); $page_title = "Not active"; $page_content = "Either the page you requested is not active, or it does not exist."; $meta = ""; $meta_keywords = ""; $active = 1; $page_id = 0; $results = DB::table('pages')->where('slug', '=', $slug)->get(); foreach ($results as $result) { $active = $result->active; if ($active > 0 || Auth::check() && Auth::user()->hasRole('pages')) { $page_title_field = Localize::localize('page_title'); $page_content_field = Localize::localize('page_content'); $page_title = $result->{$page_title_field}; $page_content = $result->{$page_content_field}; $page_id = $result->id; $meta_keywords = $result->meta_tags; $meta = $result->meta; } } return View::make('public.inside')->with('page_title', $page_title)->with('page_content', $page_content)->with('meta', $meta)->with('meta_tags', $meta_keywords)->with('active', $active)->with('page_id', $page_id)->with('menu', $this->menu); }
/** * @return mixed */ public function showProvincialData() { $slug = Request::segment(1); $page_title = "Not active"; $page_content = "Either the page you requested is not active, or it does not exist."; $meta = ""; $meta_keywords = ""; $active = 1; $page_id = 0; $menu_choice = ""; if (Cache::has('page_' . $slug . '_' . App::getLocale()) && getenv('APP_DEBUG') == false) { $results = Cache::get('page_' . $slug . '_' . App::getLocale()); } else { $results = CatraPage::where('slug', '=', $slug)->get(); Cache::forever('page_' . $slug . '_' . App::getLocale(), $results); } foreach ($results as $result) { $active = $result->active; if ($active > 0 || Auth::check() && Auth::user()->hasRole('pages')) { $page_title_field = Localize::localize('page_title'); $page_content_field = Localize::localize('page_content'); $page_title = $result->{$page_title_field}; $page_content = $result->{$page_content_field}; $page_id = $result->id; $meta_keywords = $result->meta_tags; $meta = $result->meta; } } return View::make('public.provincial-data')->with('page_title', $page_title)->with('page_content', $page_content)->with('meta', $meta)->with('meta_tags', $meta_keywords)->with('active', $active)->with('page_id', $page_id)->with('menu', $this->menu)->with('menu_choice', $menu_choice)->with('page_category_id', 2); }