Пример #1
0
 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);
     }
 }