public function friends() { if (!Session::has('steamid')) { Session::flash('message_error', 'Error: Not Logged In'); return redirect('/'); } $steamid = Session::get('steamid'); $api = new SteamAPIController(); $data = NULL; try { $data = $api->getFriends((string) $steamid); } catch (\Exception $e) { Session::flash('message_error', 'Error: Profile Not Completely Visible'); return redirect('/'); } $friends = $data["friendslist"]; $friends = $friends["friends"]; $array = array(); foreach ($friends as $friend) { array_push($array, $friend["steamid"]); } $data = $api->getPlayerSummaries($array); $data = $data["response"]; return view('friends', $data); }
public function profile() { if (!Session::has('steamid')) { return redirect('/'); } $api = new SteamAPIController(); $SteamID = Session::get("steamid"); $array = array(); array_push($array, $SteamID); $data = NULL; try { $data = $api->getPlayerSummaries($array)["response"]["players"][0]; } catch (\Exception $e) { Session::flash('message_error', 'Error: Your profile is not completely visible.'); return redirect('/'); } return view('profile', $data); }