/** * Display the specified resource. * * @param string $slug * * @return Response */ public function show($slug) { $post = $this->posts->findBySlug($slug); if (!$post) { return App::abort(404, 'Page not found'); } return View::make($this->theme . '.post', compact('post')); }
/** * Show a post preview. * * @param int $id * * @return Response */ public function getPreview($id) { $post = $this->posts->find($id); if (!Auth::check() or !$post) { return App::abort(404, 'Page not found'); } return View::make('themes.' . $this->theme . '.post', compact('post')); }
/** * Display a listing of the resource. * * @return Response */ public function getIndex() { $posts = $this->posts->active(100); $data = array('posts' => $posts, 'updated' => isset($posts[0]) ? $posts[0]->atom_date : date('Y-m-d H:i:s')); return Response::view('themes.' . $this->theme . '.atom', $data, 200, array('Content-Type' => 'application/rss+xml; charset=UTF-8')); }
/** * Fetch all tags */ public function tags() { return $this->postsRepo->allTags(); }
/** * Get the Wardrobe index. * * @return Response */ public function getIndex() { $posts = $this->posts->active(Config::get('wardrobe.per_page')); return View::make('themes.' . $this->theme . '.index', compact('posts')); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $this->posts->delete($id); }