/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($post_id) { // $post = UserPosts::getPostById($post_id); if (Auth::check()) { $post["liked"] = LikeEvent::checkLiked($post["post_id"], Auth::user()->user_id); } $post["comments"] = Post::getCommentsByPostId($post_id); return response()->json($post); }
private function getPostDetail($post_id) { $post = UserPosts::getPostById($post_id); $post_stat = PostDetails::getDetails($post_id); return [$post, $post_stat]; }