Beispiel #1
0
 public function getPreview($id)
 {
     $this->callSidebar();
     $post = Post::find($id);
     $comments = $post->comments()->where('enabled', '=', '1');
     return View::make('blog.pages.article')->with('post', $post)->with('comments', $comments)->with('preview', 1)->with('lastposts', Post::enabled()->minimum()->take(4)->get())->with('lastcomments', Comment::enabled()->take(4)->orderBy('created_at', 'DESC')->get())->with('categories', Category::all());
 }
Beispiel #2
0
 public function postDestroy()
 {
     $post = Post::find(Input::get('id'));
     if ($post) {
         $post->delete();
         return Redirect::back()->with('message', 'Post Deleted');
     }
     return Redirect::back()->with('message', 'Something went wrong, please try again');
 }