Пример #1
0
 /**
  * Shows all comments.
  * 
  * @return Response
  */
 public function index($id)
 {
     // Get all the comment models
     // TODO: This needs to be the post.id
     $comments = Comment::with($id);
     // Render the 'comments' view passing in the $comments as parameter 'comments'
     return View('comments')->with('comments', $comments);
 }
Пример #2
0
 public function store(Request $request)
 {
     $comment = new Comment();
     $comment->fill($request->all());
     $comment->user_id = Auth::user()->id;
     $comment->recipe_id = $request->get('recipe_id');
     $comment->save();
     return Comment::with('author')->where('id', $comment->id)->first();
 }
Пример #3
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $admin = Auth::user();
     $comments = Comment::with('good', 'user')->find($id);
     if (!$comments->good) {
         unset($comments->good);
         $goods = Good::onlyTrashed()->find($comments->good_id);
         $comments["good"] = $goods;
     }
     return view('admin.comments.show', ['comments' => $comments, 'admin' => $admin]);
 }
Пример #4
0
 public function show($id)
 {
     $admin = Auth::user();
     $comment = Comment::with('good', 'user')->find($id);
     return view('admin.comment.show', ['comment' => $comment, 'admin' => $admin]);
 }
Пример #5
0
 public function forNews($news_id)
 {
     return Comment::with('user')->where('news_id', $news_id)->orderBy('created_at', 'desc')->get();
 }
Пример #6
0
 /**
  * Show an existing post.
  *
  * @param  $id
  * @return Response
  */
 public function show($id)
 {
     $post = Post::findOrFail($id);
     $comments = Comment::with('post_id', '=', $id);
     // Show feed data
     //		// GetStream-Laravel
     //		$user_id = Auth::id();
     //		$feed = FeedManager::getUserFeed('cjsimon');
     //		$enricher = new Enrich;
     //		$feed_activities = $feed->getActivities(0, 25); // Not retrieving anything
     //		$activities = $feed_activities['results'];
     //		$activities = $enricher->enrichActivities($activities);
     // PHP GetStream Library
     $activities = self::$client->feed('post', $post->id)->getActivities();
     $activities = $activities['results'];
     return View('posts.show')->with('post', $post)->with('comments', $comments)->with('activities', $activities);
 }
Пример #7
0
 public function getPostComment($id)
 {
     return Comment::with('posts')->find($id);
 }
Пример #8
0
 /**
  * Display the specified resource.
  *
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $comment = Comment::with('content')->findOrFail($id);
     return view('backend.comments.show', compact('comment'));
 }