2017 © Pedro Peláez
 

library laravel-pubg

Laravel Package for Official PUBG API

image

saadj55/laravel-pubg

Laravel Package for Official PUBG API

  • Thursday, April 12, 2018
  • by saadj55
  • Repository
  • 2 Watchers
  • 2 Stars
  • 61 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 74 % Grown

The README.md

Laravel Package for PUBG API

A Laravel Package for PUBG Official API, (*1)

Total Downloads License, (*2)

Installation

Require this package with composer., (*3)

composer require saadj55/laravel-pubg

Setup

Laravel 5.5+ Integration

Package discovery is enabled so need for additional configuration., (*4)

Laravel 5.* Integration

After installation, open config/app.php and add the following line to providers key Saadj55\LaravelPubg\Providers\LaravelPubgServiceProvider::class, After that, run the following command to publish configuration file., (*5)

php artisan vendor:publish

Set your access token in the .env file as PUBG_ACCESS_TOKEN=<access_token>, (*6)

Set the region you want to query as PUBG_REGION=<region> in the .env file., (*7)

Set the platform you want to query as PUBG_PLATFORM=<platform> in the .env file, (*8)

Usage

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;, (*9)

API

getPlayerById

$pubg = new Pubg;
$player = $pubg->getPlayerById($player_id);

getPlayersByIds

$pubg = new Pubg;
$player_ids = [1,2,3,4,5];
$player = $pubg->getPlayersByIds($player_ids);

getPlayersByNames

$pubg = new Pubg;
$player_names = ['foo','bar'];
$player = $pubg->getPlayersByName($player_names);

getMatchById

$pubg = new Pubg;
$match = $pubg->getMatchById($match_id);

By default, region name is set from the app/config/pubg.php. 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 $pubg->setPlatform($platform), (*10)

The Versions

12/04 2018

dev-master

9999999-dev

Laravel Package for Official PUBG API

  Sources   Download

MIT

The Requires

 

by Saad Nasir Siddique

laravel api pubg pubgapi laravelpackage