Laravel Package for Official PUBG API
A Laravel Package for PUBG Official API
Require this package with composer.
composer require saadj55/laravel-pubg
Package discovery is enabled so need for additional configuration.
After installation, open
config/app.php and add the following line to
After that, run the following command to publish configuration file.
php artisan vendor:publish
Set your access token in the
.env file as
Set the region you want to query as
PUBG_REGION=<region> in the
Set the platform you want to query as
PUBG_PLATFORM=<platform> in the
You can simply use the API by adding
use Saadj55\LaravelPubg\Pubg; wherever you want to call the API
and making a new instance of the
Pubg class as
$pubg = new Pubg;
$pubg = new Pubg; $player = $pubg->getPlayerById($player_id);
$pubg = new Pubg; $player_ids = [1,2,3,4,5]; $player = $pubg->getPlayersByIds($player_ids);
$pubg = new Pubg; $player_names = ['foo','bar']; $player = $pubg->getPlayersByName($player_names);
$pubg = new Pubg; $match = $pubg->getMatchById($match_id);
By default, region name is set from the
If you need to set the region on the fly, You can call
$pubg->setRegion($region_name) before calling any
of the above methods.
You can also call