public static function getBoardById($board_id)
 {
     $result["board"] = Board::where('board_id', $board_id)->first();
     $result["posts"] = UserPosts::where('board_id', $board_id)->get();
     $result["board"]["cover_link"] = $result["posts"][0]["photo_link"];
     $result["profile"]["number_of_posts"] = Post::where('board_id', $board_id)->count();
     $result["profile"]["number_of_following"] = FollowEvent::countFollower($board_id);
     return $result;
 }
Example #2
0
 public static function getBoardById($board_id)
 {
     $board = Board::where("board_id", $board_id)->first();
     $board["preview"] = Board::getPreviewBoard($board_id);
     return $board;
 }