/** * Returns the URL for the master object of given ID * * @param MenuItem $item Master object iD * * @return string */ public function getUrl(MenuItem $item) { $page_url = Settings::get('blog_category_page', 'blog/category'); $category = Category::find($item->master_object_id); if (!$category) { throw new ApplicationException("Category not found."); } return URL::to($page_url . '/' . $category->slug); }
/** * Returns the URL for the master object of given ID * * @param MenuItem $item Master object iD * * @return string */ public function getUrl(MenuItem $item) { $page_url = Settings::get('blog_post_page', 'blog/post'); $post = Post::find($item->master_object_id); if (!$post) { throw new ApplicationException("Post not found."); } return URL::to($page_url . '/' . $post->slug); }
/** * Internal method, prepare the list model object */ protected function createModel() { return SettingsModel::instance(); }