poniverse / api
PHP Library to access the Poniverse APi
dev-master
2017-06-11 00:33 UTC
Requires
- php: >=5.4.0
- guzzlehttp/guzzle: 4.*
- illuminate/support: 4.1.*
Requires (Dev)
- mockery/mockery: dev-master
- phpunit/phpunit: 4.0.*
- satooshi/php-coveralls: dev-master
This package is auto-updated.
Last update: 2024-12-12 04:20:14 UTC
README
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