Skip to content

An official PHP library implementation of the Poniverse API.

License

Notifications You must be signed in to change notification settings

Poniverse/poniverse-php

Repository files navigation

poniverse-php

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

About

An official PHP library implementation of the Poniverse API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages