/** * @return mixed */ private function getPageBySlug() { $path = Request::path(); //ie whatever/subpage/and-so-on $slugs = explode("/", $path); $first_slug = $slugs['0']; $last_slug = $slugs[count($slugs) - 1]; $slug = $last_slug; //Page by Slug $page = Page::with("content")->published()->where('slug', '=', $slug)->first(); return $page; }