Closed safakocamanoglu closed 4 years ago
I checked this problem.
The problem was that the service provider's parameter exception was insufficient.
The current issue is where the DataDragon API checks the region
value and it is null
(or invalid region).
Define the RIOT_API_REGION
value in the .env
file with valid region.
I will make sure that the project can be run without invalid variables. Thank you for reporting!
In addition, When running scripts inside the controller
use RiotAPI\LeagueAPI\LeagueAPI;
$summoner = app('league-api')->getSummonerByName('__SOMEONE__');
$matchList = LeagueAPI::getMatchlistByAccount($summoner->accountId);
When we use it as above, we get an error saying "Non-static method RiotAPI\LeagueAPI\LeagueAPI::getMatchlistByAccount() should not be called statically".
use LeagueAPI;
$summoner = app('league-api')->getSummonerByName('SOMEONE'); $matchList = LeagueAPI::getMatchlistByAccount($summoner->accountId);
It works fine when used this way, but phpstorm does not show the hints of the code to be used after writing "LegueAPI ::". example: getMatchlistByAccount () function and parameters
3. Method )
As in the 2nd method, when used in this way, the api query works, but the suggestions do not appear.
use LeagueAPI;
$summoner = app('league-api')->getSummonerByName('SOMEONE'); $matchList = app('league-api')->getMatchlistByAccount($summoner->accountId);
You are tired of me, but what is your recommendation for correct use?
My first language is not English, so please understand even if there is an error in context.
LeagueAPI
and RiotAPI\LeagueAPI\LeagueAPI
are definitely different classes. (for more information, see PSR-4)
RiotAPI\LeagueAPI\LeagueAPI
has not yet created an object.
So, non-static methods cannot be used.
LeagueAPI
used Laravel's Facades concept, app()
and resolve()
are Laravel's helper function.
These call up objects defined by the service provider.
It will be helpful if you refer to Architecture Concepts > Facades in the Laravel document.
This requires an understanding of dependancy injection first.
Code analysis is performed dynamically and therefore may not be properly worked in IDE. Here is a useful package that solves this. https://github.com/barryvdh/laravel-ide-helper
When I run composer for installation I get argument error
composer require blood72/laravel-riot-api
Terminal error code start
Terminal error code finish
I'm new to Laravel yet, couldn't find a valid method to run the package. Thank you in advance for your help