2017 © Pedro Peláez
 

library igdb

Laravel PHP Facade/Wrapper for the IGDB API

image

messerli90/igdb

Laravel PHP Facade/Wrapper for the IGDB API

  • Sunday, August 6, 2017
  • by messerli90
  • Repository
  • 1 Watchers
  • 26 Stars
  • 1,588 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 3 Open issues
  • 3 Versions
  • 25 % Grown

The README.md

IGDB (Internet Game Database)

Build Status Built For Laravel License Total Downloads, (*1)

Introduction

This packages provides a nice and easy wrapper around the IGDB API for use in your Laravel application., (*2)

In order to use the IGDB API, you must have a account and key. You can register your app at https://api.igdb.com/., (*3)

Installation

Add messerli90/igdb to your composer.json., (*4)

"messerli90/igdb": "~1.0"

or, (*5)

composer require messerli90/igdb

Run composer update to pull down the latest version of the package., (*6)

Now open up app/config/app.php and add the service provider to your providers array., (*7)

'providers' => array(
    Messerli90\IGDB\IGDBServiceProvider::class,
)

Optionally, add the facade to your aliases array, (*8)

'IGDB' => \Messerli90\IGDB\Facades\IGDB::class,

Configuration

Add the igdb to your config/services.php array. Set cache to a number of minutes to cache responses., (*9)

'igdb' => [
    'key' => 'YOUR_IGDB_KEY',
    'url' => 'YOUR_IGDB_URL',
    'cache' => 0
]

Usage

// Get Game by ID
$game = IGDB::getGame(9630);

// Customize / limit the returned fields
$games = IGDB::getGame(9630, ['name', 'release_dates', 'esrb', 'genres'], $limit = 10, $offset = 0, $order = 'release_dates.date:desc');

// Search Games by name
$games = IGDB::searchGames('fallout');

// Get Character by ID
$character = IGDB::getCharacter(4534);

// Search Characters by name
$characters = IGDB::searchCharacters('fisher');

// Get upcoming releases
$releases = IGDB::getReleases($filters = ['filter[platform][eq]=48', 'filter[date][gt]=1500619813000], $fields = ['*'], $limit = 10, $offset = 0, $order = 'date:asc');

// Get Company by ID
$companies = IGDB::getCompany('ubisoft');

// Search Company by name
$company = IGDB::getCompany(7041);

// Get Franchise by ID
$franchise = IGDB::getFranchise(133);

// Search Franchise by name
$franchises = IGDB::searchFranchises('Harry Potter');

// Get Game Mode by Id
$game_mode = IGDB::getGameMode(1);

// Search Game Modes by name
$game_modes = IGDB::searchGameModes('Single Player');

// Get Genre by ID
$genre = IGDB::getGenre(15);

// Search Genres by name
$genres = IGDB::searchGenres('strategy');

// Get Keyword by ID
$keyword = IGDB::getKeyword(121);

// Search Keyword by name
$keywords = IGDB::searchKeywords('sandbox');

// Get Person by ID
$person = IGDB::getPerson(24354);

// Search People by name
$people = IGDB::searchPeople('Delaney');

// Get Platform by ID
$platform = IGDB::getPlatform(49);

// Search Platforms by name
$platforms = IGDB::searchPlatforms('xbox');

// Get Player Perspective by ID
$player_perspective = IGDB::getPlayerPerspective(7);

// Search Player Perspective by name
$player_perspectives = IGDB::searchPlayerPerspectives('Virtual');

// Get Pulse by ID
$pulse = IGDB::getPulse(20707);

// Fetch latest Pulses
$pulses = IGDB::fetchPulses();

// Get Collection / Series by ID
$collection = IGDB::getCollection(3);

// Search Collections / Series by name
$collections = IGDB::searchCollections('fallout');

// Get Theme by ID
$theme = IGDB::getTheme(39);

// Search Themes by name
$themes = IGDB::searchThemes('warfare');

Format of returned data

The returned JSON data is decoded as a PHP object., (*10)

Run Unit Test

If you have PHPUnit installed in your environment, run:, (*11)

$ phpunit

IGDB API

Contributing

Please see CONTRIBUTING for details., (*12)

Credits

License

The MIT License (MIT). Please see License File for more information., (*13)

The Versions

06/08 2017

dev-master

9999999-dev

Laravel PHP Facade/Wrapper for the IGDB API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Messerli

laravel api gaming igdb messerli90

06/08 2017

1.0.0

1.0.0.0

Laravel PHP Facade/Wrapper for the IGDB API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Messerli

laravel api gaming igdb messerli90

02/01 2017

v0.1-alpha

0.1.0.0-alpha

Laravel PHP Facade/Wrapper for the IGDB API

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Michael Messerli

laravel api gaming igdb messerli90