PHP Library to access the Poniverse APi

dev-master 2017-06-11 00:33 UTC

This package is auto-updated.

Last update: 2024-04-12 02:57:30 UTC


README

Build Status Scrutinizer Code Quality Code Coverage

Installation

Require this package in composer.json and update

"poniverse/api": "dev-master"

Normal Setup

Example Code:

$config = [
    'client_id' => 'YOUR_CLIENT_ID'
    'client_secret' => 'YOUR_CLIENT_SECRET'
    'host_url' => 'https://api.poniverse.net'
];

$poniverse = new Poniverse(
    $config['client_id'],
    $config['client_secret'],
    new Client([
        'base_url' => [$config['host_url'], ['version' => 'v' . Poniverse::VERSION]]
    ])
);

$poniverse->setAccessToken('GRANTED_ACCESS_TOKEN');

$user = $poniverse->user->get();
// $user['display_name'];
// $user['email'];

Laravel 4 Setup

Open up app/config/app.php and add this line in your providers section

'Poniverse\Api\ApiServiceProvider',

In the same file add this line to the aliases section

'Poniverse' => 'Poniverse\Api\Facades\Poniverse',

Publish the configuration and then edit it

php artisan config:publish poniverse/api