public static function getPostsByFollowingUserId($user_id) { if (isset($user_id)) { $list_id = FollowEvent::where('follower_id', $user_id)->get(['following_id']); return UserPosts::whereIn('user_id', $list_id)->get(); } }
public static function countFollower($user_id) { $number_following_id = FollowEvent::where('following_id', $user_id)->count(); return $number_following_id; }