public function getUser($user_name) { $user = User::getUserByName($user_name); if (Auth::check()) { $current_user_id = Auth::user()->user_id; $bool = FollowEvent::checkFollowed($current_user_id, $user["user_id"]); if ($bool == true) { $user["follow"] = "true"; } } $id = $user->user_id; $list = UserPosts::getPostByUserId($id); $profile = User::getProfile($id); $boards = Board::getPreviewBoardsByUserId($id); $followers = FollowEvent::getFollower($id); $following = FollowEvent::getFollowing($id); if ($user) { return response()->view('profile', ["user" => $user, "posts" => $list, "profile" => $profile, "boards" => $boards, "followers" => $followers, "followings" => $following]); } else { return response()->json("Not found"); } }