josephting/lolapi-4-laravel

This package is abandoned and no longer maintained. The author suggests using the league-php/leaguewrap package instead.

League of Legends API Service Provider for Laravel 4

1.0.0 2014-09-22 18:35 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:39:52 UTC


README

[DEPRECATED] This repo is no longer maintained. Migrate to LeaguePHP/LeagueWrap.

lolapi-4-laravel is a simple laravel 4 service provider (wrapper) for paquettg/leaguewrap which aims to assist application development that depends on the League of Legends API easily.

Installation

Add lolapi-4-laravel to your composer.json file:

"require": {
  "josephting/lolapi-4-laravel": "dev-master"
}

Use composer to install this package.

$ composer update

Registering the Package

Register the service provider within the providers array found in app/config/app.php:

'providers' => array(
	// ...

	'Josephting\LolApi\LolApiServiceProvider',
)

Add an alias within the aliases array found in app/config/app.php:

'aliases' => array(
	// ...

	'LolApi'          => 'Josephting\LolApi\Facade\LolApi',
)

Configuration

There are two ways to configure lolapi-4-laravel. You can choose the most convenient way for you. You can use package config file which can be generated through command line by artisan (option 1) or you can simply create a config file called lolapi-4-laravel.php in your app\config\ directory (option 2).

Option 1

Create configuration file for package using artisan command

$ php artisan config:publish josephting/lolapi-4-laravel

Option 2

Create configuration file manually in config directory app/config/lolapi-4-laravel.php and put there code from below.

<?php

return array(

    'api_key' => ''

);

Credentials

Add your credentials to app/config/packages/josephting/lolapi-4-laravel/config.php or app/config/lolapi-4-laravel.php (depending on which option of configuration you choose)

Usage

Basic usage

You can simply load up the API with:

$api = LolApi:Api();

It is possible to override the ApiKey in config by passing in a parameter:

$api = LolApi:Api('YOUR_API_KEY');

Usage examples:

For more examples go here