Beispiel #1
0
 /**
  * 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'));
 }
Beispiel #2
0
 /**
  * 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'));
 }
Beispiel #3
0
 /**
  * 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'));
 }
Beispiel #4
0
 /**
  * Fetch all tags
  */
 public function tags()
 {
     return $this->postsRepo->allTags();
 }
Beispiel #5
0
 /**
  * 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'));
 }
Beispiel #6
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $this->posts->delete($id);
 }