PHPackages                             maras0830/laravel5-battlenet-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. maras0830/laravel5-battlenet-api

ActiveLibrary[API Development](/categories/api)

maras0830/laravel5-battlenet-api
================================

Laravel5 BattleNet Api

v1.0.7(8y ago)35991MITPHP

Since Mar 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Maras0830/laravel5-battlenet-api)[ Packagist](https://packagist.org/packages/maras0830/laravel5-battlenet-api)[ RSS](/packages/maras0830-laravel5-battlenet-api/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (9)Used By (0)

Laravel5-BattleNet-API
======================

[](#laravel5-battlenet-api)

The Battle.net API uses OAuth 2.0, a federated access control mechanism, to help secure sections of the APIs that we provide out to the public. By using OAuth, you can let Battle.net handle the authentication process and receive a unique ID representing that user, then use an access token to gain access to allowed resources like their World of Warcraft characters, StarCraft II profile, or other data as appropriate. The usage of OAuth itself is relatively simple, but the flows can seem a little intimidating at first. Hopefully, by following the processes below, you can quickly integrate with Battle.net and worry more about building that cool idea and less about how to get data from players.

BattleNet oAuth just provide simple account information(battlenet account id, battlenet tag), Like this:

```
{
    "id": XXXXXXXX,
    "battletag": "Maras#3218"
}
```

\*Just support oauth and get authenticated user, and I will develop WOW and SC2 Game Data API in the future and welcome evenyone if you also love laravel and Blizzard join.

See official Github [Blizzard Github](https://github.com/Blizzard)See official API Document [Battle.Net Developer](https://dev.battle.net/)

Installation
------------

[](#installation)

將 package 加入 `composer.json`
Require the package in composer.json :

```
"maras0830/laravel5-battlenet-api": "dev-master"
```

在 ``config/app.php`加入 providers   In`config/app.php``` add ```providers```

```
Maras0830\BattleNetApi\Providers\ApiServiceProvider::class
```

In `config/app.php` add `aliases`

```
'BattleNetApi'             => Maras0830\BattleNetApi\Facades\ApiServiceFacade::class,
```

發行設定
Publish config.

```
php artisan vendor:publish --force
```

發行後你在 config 資料夾下會發現 `config/battlenet-api.php` ，並且根據 [Battle.Net Developer](https://dev.battle.net/) 進行註冊與開發者配置 you will find config file after published, register abd set up by [Battle.Net Developer](https://dev.battle.net/)

```
return [
    'region' => env('Battle_net_region', 'sea'),
    'api_url' => "https://". env('Battle_net_region', 'sea') .".api.battle.net",
    'api_url_cn' => "https://api.battle.com.cn/",
    'client_id' => env('Battle_net_client_id', ''),
    'client_secret' => env('Battle_net_client_secret', ''),
    'redirect_url' => env('APP_URL'). '/' .env('Battle_net_redirect_url', '') . '/battleNet/callback',
    'scopes' => [
        'wow.profile',
        'sc2.profile'
    ]
];
```

USAGE
-----

[](#usage)

you can use authenticationURL on routes and controller, like this:

routes:

```
Route::get('battleNet', 'auth\social\AuthController@redirectToProvider_BattleNet');
Route::get('battleNet/callback', 'auth\social\AuthController@handleProviderCallback_BattleNet');
```

```
public function redirectToProvider_BattleNet()
{
    return redirect(BattleNetApi::authenticationURL()); // redirect to BattleNet login page
}
```

And callback function:

```
public function handleProviderCallback_BattleNet()
{
    $social_type = "BattleNet";

    if (isset($_GET['code'])) {
        $code = $_GET['code'];

        $token = BattleNetApi::requestToken($code);

        $account = BattleNetApi::authenticatedUser($token);
    } else
        return redirect('/')->withErrors('failed.');

}
```

OAuth 2.0
---------

[](#oauth-20)

OAuth 2.0 is the next evolution of the OAuth protocol which was originally created in late 2006. OAuth 2.0 focuses on client developer simplicity while providing specific authorization flows for web applications, desktop applications, mobile phones, and living room devices. This specification is being developed within the IETF OAuth WG and is based on the OAuth WRAP proposal.

HTTPS
-----

[](#https)

One of the major changes to OAuth when releasing version 2.0 was removing transport considerations from the protocol, instead relying on implementors to handle the transport of codes and tokens themselves. What this means in practical terms is that HTTPS is required, and for extra security, checking the cert during the HTTPS handshake is recommended. This will prevent any surprises and will prevent the codes from being captured while in transit.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 90.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~29 days

Recently: every ~51 days

Total

8

Last Release

3177d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ea1aaf015e5b965c29ba390d0883f84d740b2b8ad8ef5ee530b6c22a91ba440?d=identicon)[Maras0830](/maintainers/Maras0830)

---

Top Contributors

[![Maras0830](https://avatars.githubusercontent.com/u/7960232?v=4)](https://github.com/Maras0830 "Maras0830 (10 commits)")[![ericliao79](https://avatars.githubusercontent.com/u/13558443?v=4)](https://github.com/ericliao79 "ericliao79 (1 commits)")

---

Tags

laravelbattle.net

### Embed Badge

![Health badge](/badges/maras0830-laravel5-battlenet-api/health.svg)

```
[![Health](https://phpackages.com/badges/maras0830-laravel5-battlenet-api/health.svg)](https://phpackages.com/packages/maras0830-laravel5-battlenet-api)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M932](/packages/statamic-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[moe-mizrak/laravel-openrouter

Laravel package for OpenRouter (A unified interface for LLMs)

157177.9k2](/packages/moe-mizrak-laravel-openrouter)[flat3/lodata

OData v4.01 Producer for Laravel

100351.7k](/packages/flat3-lodata)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
