PHPackages                             strebl/laravel-league-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. strebl/laravel-league-api

ActiveLibrary

strebl/laravel-league-api
=========================

A LeagueWrap bridge for Laravel

v0.1.0-alpha(9y ago)111[1 issues](https://github.com/strebl/laravel-league-api/issues)MITPHPPHP ^5.6.4 || ^7.0

Since Nov 18Pushed 9y ago1 watchersCompare

[ Source](https://github.com/strebl/laravel-league-api)[ Packagist](https://packagist.org/packages/strebl/laravel-league-api)[ RSS](/packages/strebl-laravel-league-api/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

Laravel LeagueApi
=================

[](#laravel-leagueapi)

> A [League PHP / LeagueWrap](https://github.com/LeaguePHP/LeagueWrap) bridge for Laravel.

```
// Set the region (default: na).
LeagueApi::setRegion('euw');

// Get info about a summoner.
LeagueApi::summoner()->info('liqy');

// Get the recent games for liqy.
LeagueApi::game()->recent(LeagueApi::summoner()->get('liqy'));
```

[![Build Status](https://camo.githubusercontent.com/3063d3cf38b0f51cce7e442c31947fd629e129bdf28b439f307588159102b154/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f73747265626c2f6c61726176656c2d6c65616775652d6170692f6d61737465722e7376673f7374796c653d666c6174)](https://travis-ci.org/strebl/laravel-league-api)[![StyleCI](https://camo.githubusercontent.com/056515cfa3e678bd8ae29deb2732f295047f6dfde0c7c6018b4a1c4f88774496/68747470733a2f2f7374796c6563692e696f2f7265706f732f37343037353739372f736869656c643f7374796c653d666c6174)](https://styleci.io/repos/74075797)[![Coverage Status](https://camo.githubusercontent.com/7d5f6502feb7027b477631f6e228a3651a45be1e18f40d161b127c791f0666b7/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f73747265626c2f6c61726176656c2d6c65616775652d6170692e7376673f7374796c653d666c6174)](https://codecov.io/github/strebl/laravel-league-api)[![Latest Version](https://camo.githubusercontent.com/9834353549c0830517de8262dfa5a15a6ec98670a63f2eccd56b01351aec056f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f73747265626c2f6c61726176656c2d6c65616775652d6170692e7376673f7374796c653d666c6174)](https://github.com/strebl/laravel-league-api/releases)[![License](https://camo.githubusercontent.com/e45bc30cdd19f17bb9c79054cba57cf03a7133eb11507cd3aa207e51bbc33d6c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73747265626c2f6c61726176656c2d6c65616775652d6170692e7376673f7374796c653d666c6174)](https://packagist.org/packages/strebl/laravel-league-api)

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

[](#installation)

Require this package, with [Composer](https://getcomposer.org/), in the root directory of your project.

```
$ composer require strebl/laravel-league-api
```

Add the service provider to `config/app.php` in the `providers` array.

```
Strebl\LeagueApi\LeagueApiServiceProvider::class
```

If you want you can use the [facade](http://laravel.com/docs/facades). Add the reference in `config/app.php` to your aliases array.

```
'LeagueApi' => Strebl\LeagueApi\Facades\LeagueApi::class
```

Configuration
-------------

[](#configuration)

Laravel LeagueApi requires connection configuration. To get started, you'll need to publish all vendor assets:

```
$ php artisan vendor:publish
```

This will create a `config/league-api.php` file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.

#### Default Connection Name

[](#default-connection-name)

This option `default` is where you may specify which of the connections below you wish to use as your default connection for all work. Of course, you may use many connections at once using the manager class. The default value for this setting is `main`.

#### LeagueApi Connections

[](#leagueapi-connections)

This option `connections` is where each of the connections are setup for your application. Example configuration has been included, but you may add as many connections as you would like.

Usage
-----

[](#usage)

#### LeagueApiManager

[](#leagueapimanager)

This is the class of most interest. It is bound to the ioc container as `league-api` and can be accessed using the `Facades\LeagueApi` facade. This class implements the ManagerInterface by extending AbstractManager. The interface and abstract class are both part of [Graham Campbell's](https://github.com/GrahamCampbell) [Laravel Manager](https://github.com/GrahamCampbell/Laravel-Manager) package, so you may want to go and checkout the docs for how to use the manager class over at that repository. Note that the connection class returned will always be an instance of `LeagueWrap\Api`.

#### Facades\\LeagueApi

[](#facadesleagueapi)

This facade will dynamically pass static method calls to the `league-api` object in the ioc container which by default is the `LeagueApiManager` class.

#### LeagueApiServiceProvider

[](#leagueapiserviceprovider)

This class contains no public methods of interest. This class should be added to the providers array in `config/app.php`. This class will setup ioc bindings.

### Examples

[](#examples)

Here you can see an example of just how simple this package is to use. Out of the box, the default adapter is `main`. After you enter your authentication details in the config file, it will just work:

```
// You can alias this in config/app.php.
use Strebl\LeagueApi\Facades\LeagueApi;

LeagueApi::summoner()->info('liqy');
// That's everything. It works!
```

The LeagueApi manager will behave like it is a `LeagueWrap\Api`. If you want to call specific connections, you can do that with the connection method:

```
use Strebl\LeagueApi\Facades\LeagueApi;

// Writing this…
LeagueApi::connection('main')->summoner()->info('liqy');

// …is identical to writing this
LeagueApi::summoner()->info('liqy');

// and is also identical to writing this.
LeagueApi::connection()->summoner()->info('liqy');

// This is because the main connection is configured to be the default.
LeagueApi::getDefaultConnection(); // This will return main.

// We can change the default connection.
LeagueApi::setDefaultConnection('alternative'); // The default is now alternative.
```

If you prefer to use dependency injection over facades, then you can inject the manager:

```
use Strebl\LeagueApi\LeagueApiManager;

class Foo
{
	protected $leagueApi;

	public function __construct(LeagueApiManager $leagueApi)
	{
		$this->leagueApi = $leagueApi;
	}

	public function bar($name)
	{
		$this->leagueApi->summoner()->info($name);
	}
}

App::make('Foo')->bar();
```

Documentation
-------------

[](#documentation)

There are other classes in this package that are not documented here. This is because the package is a Laravel wrapper of [League PHP's](https://github.com/LeaguePHP) [LeagueWrap package](https://github.com/LeaguePHP/LeagueWrap).

License
-------

[](#license)

[MIT](LICENSE) © [Manuel Strebel](https://strebel.xyz)

❤️
--

[](#️)

I used [Vincent Klaiber's](https://github.com/vinkla) packages as a base for this package. I really like his packages!

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

3460d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/88b33a36bab321756e8266b4db8866aaf78d3ced81e9fd896d427eb08a39097b?d=identicon)[strebl](/maintainers/strebl)

---

Top Contributors

[![strebl](https://avatars.githubusercontent.com/u/6151204?v=4)](https://github.com/strebl "strebl (7 commits)")

---

Tags

laravelleague of legendsRiotriot-gamesleaguewrapleague wrapleague apileague-phpleague of legends API

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/strebl-laravel-league-api/health.svg)

```
[![Health](https://phpackages.com/badges/strebl-laravel-league-api/health.svg)](https://phpackages.com/packages/strebl-laravel-league-api)
```

###  Alternatives

[vinkla/hashids

A Hashids bridge for Laravel

2.1k13.3M73](/packages/vinkla-hashids)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k84.2M225](/packages/laravel-horizon)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[spatie/laravel-prometheus

Export Laravel metrics to Prometheus

2651.3M6](/packages/spatie-laravel-prometheus)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

3786.5k](/packages/harris21-laravel-fuse)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)

PHPackages © 2026

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