Poniverse / poniverse-php by Lavoaster

PHP Library to access the Poniverse APi
215
2
15
Package Data
Maintainer Username: Lavoaster
Maintainer Contact: adam@lavoaster.co.uk (Adam Lavin)
Package Create Date: 2013-10-20
Package Last Update: 2023-09-12
Language: PHP
License: MIT
Last Refreshed: 2024-04-23 03:01:19
Package Statistics
Total Downloads: 215
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 2
Total Watchers: 15
Total Forks: 1
Total Open Issues: 1

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