xklusive / laravel-battlenet-api by xklusive

Laravel 5 client for Battle.net API
358
8
4
Package Data
Maintainer Username: xklusive
Maintainer Contact: xklusive91@gmail.com (Guillaume Meheust)
Package Create Date: 2017-01-18
Package Last Update: 2018-09-27
Language: PHP
License: MIT
Last Refreshed: 2024-11-19 03:09:40
Package Statistics
Total Downloads: 358
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 8
Total Watchers: 4
Total Forks: 3
Total Open Issues: 7

Laravel 5 Battle.net API

Latest Version on Packagist Software License Build Status Code Quality SensioLabsInsight StyleCI Codacy Badge Total Downloads Average time to resolve an issue Percentage of issues still open

This package allows to call the Battle.net API.

Once installed you can do stuff like this:

use Xklusive\BattlenetApi\Services\WowService;

public function index(WowService $wow)
{
	$achievement = $wow->getAchievement(2144);

	dd($achievement);

	//Ouput: 
	//Collection {#236 ▼
  	//	#items: array:10 [▼
	//	    "id" => 2144
	//	    "title" => "Voyages au bout du monde"
	//	    "points" => 50
	//	    "description" => "Accomplir les hauts faits des évènements mondiaux listés ci-dessous."
	//	    "reward" => "Récompense : proto-drake pourpre"
	//	    "rewardItems" => array:1 [▶]
	//	    "icon" => "achievement_bg_masterofallbgs"
	//	    "criteria" => array:8 [▶]
	//	    "accountWide" => true
	//	    "factionId" => 2
	//	]
}

Battle.net API key

Before you be able to make requests to the Battle.net API, you need to provide your API key. If you don't have an API key, refer to https://dev.battle.net/docs to get your API key. Without a Battle.net API key, the package will not be functionnal.

Install

You can install the pacakge via composer:

$ composer require xklusive/laravel-battlenet-api

Then this provider must be installed :

// config/app.php
'providers' => [
	...
    Xklusive\BattlenetApi\BattlenetApiServiceProvider::class,
];

The last required step is to publish configuration's file in your application with :

$ php artisan vendor:publish --provider="Xklusive\BattlenetApi\BattlenetApiServiceProvider" --tag="config"

Once the config file is published setup the required variables in the .env file :

// .env

BATTLENET_KEY=[YOUR_API_KEY]
BATTLENET_REGION=eu

Congratulations, you have successfully installed Laravel Battle.net API !