Closed savisaar2 closed 9 years ago
You are missing one call to get the right api object. It might be a bit confusing because the names are identical but what you want to do is this:
public function matchHistory(Request $request)
{
$api = new Api(env('LOL_API_KEY'));
$matchlistEndpoint = $api->matchlist();
$matchlistt = $matchlistEndpoint->matchlist($request->summoner_id);
}
the reason is that the api class hosts multiple services (one per endpoint from https://developer.riotgames.com/api/methods). Api#matchlist() will return you the correct endpoint object for doing matchlist requests. This matchlist object has a method to do actual calls to the matchlist api Matchlist#matchlist($summonerid, other params...)
When i try to retrieve matchlist i get this error: The api class "LeagueWrap\Api\Matchlist" was not found.
this is the function: