public function postReply($id = 0) { $parent = TalkPost::findOrFail($id); if ($parent) { $input = (object) Input::only('content'); $post = new TalkPost(); $post->title = ''; $post->content = $input->content; $post->category_id = $parent->category_id; $post->parent_id = $parent->id; $post->user_id = Auth::user()->id; } if ($post->save()) { return Redirect::to(Config::get('talk::routes.base') . '/read/' . $parent->slug . '/#post-' . $post->id); } }
public function getIndex() { $tags = TalkTag::orderBy('name')->whereActive(1)->get(); $categories = TalkCategory::orderBy('name')->whereActive(1)->get(); $posts = TalkPost::orderBy('created_at', 'DESC')->whereParent_id(0)->take(10)->get(); $this->layout->content = View::make('talk::home.index')->with('tags', $tags)->with('posts', $posts)->with('categories', $categories); }
public function missingMethod($parameters = array()) { $post = TalkPost::whereSlug($parameters[0])->first(); if (null != $post) { $comments = TalkPost::where('parent_id', '=', $post->id)->get(); $this->layout->content = View::make('talk::read.post', compact('post', 'comments')); } }
public function index() { $posts = TalkPost::paginate(15); $this->layout->content = View::make('talk::admin.posts.index', compact('posts')); }
public function getIndex() { $posts = TalkPost::whereParent_id(0)->orderBy('created_at', 'DESC')->paginate(15); $this->layout->content = View::make('talk::list.index', compact('posts')); }