1. Go to this page and download the library: Download refatbd/game-account-lookup library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Refatbd\GameAccountLookup\GameAccountLookup;
public function check(GameAccountLookup $lookup)
{
return response()->json(
$lookup->check('pubgm', request('player_id'))
);
}
use Refatbd\GameAccountLookup\Laravel\Facades\GameAccountLookup;
$result = GameAccountLookup::check('mlbb', 'USER_ID', 'ZONE_ID');
use Refatbd\GameAccountLookup\Contracts\ProviderInterface;
use Refatbd\GameAccountLookup\DTO\LookupResult;
final class OfficialGameProvider implements ProviderInterface
{
public function key(): string
{
return 'official_game';
}
public function supports(array $game): bool
{
return isset($game['providers'][$this->key()]);
}
public function lookup(
array $game,
string $playerId,
?string $zoneId = null
): LookupResult {
// Call an authorized API here.
return LookupResult::success(
$game['code'],
$playerId,
'PlayerName',
$this->key(),
$zoneId,
);
}
}