public function getPosts($categoryID) { $category = $this->categoryRepository->findById($categoryID); $posts = $this->blogRepository->model->where('category_id', $category->id)->paginate(5); $categories = $this->categoryRepository->getPostCategories()->get(); $this->title = $category->name; $this->render('site.category.blogs', compact('posts', 'categories')); }
/** * Show the form for editing the specified resource. * @param $id * @internal param $post * @return Response */ public function edit($id) { $title = Lang::get('admin.blogs.title.blog_update'); $category = $this->select + $this->categoryRepository->getPostCategories()->lists('name_ar', 'id'); $author = $this->select + $this->userRepository->getRoleByName('author')->lists('username', 'id'); $post = $this->blogRepository->findById($id); $tags = $this->tagRepository->getList('name_ar', 'id'); $dbTags = $post->tags->lists('id'); // Show the page $this->render('admin.blogs.edit', compact('post', 'title', 'category', 'author', 'tags', 'dbTags')); }