pod-point / my-utility-genius-php
This package is abandoned and no longer maintained.
No replacement package was suggested.
A PHP library for communicating with the My Utility Genius API
dev-master
2019-02-15 16:47 UTC
Requires
- php: >=7.1
- guzzlehttp/guzzle: ~6.0
- kamermans/guzzle-oauth2-subscriber: ^1.0
- laravel/framework: ~5.0
Requires (Dev)
- orchestra/testbench: ~3.0
- phpunit/phpunit: ^7.4
This package is auto-updated.
Last update: 2023-03-16 02:15:07 UTC
README
A PHP library for communicating with the My Utility Genius API
Installation
Require the package in composer:
"require": { "pod-point/my-utility-genius-php": "^1.0" },
Laravel
If you are using a recent version of Laravel the service provider will automatically
be registered. If not update your config/app.php
providers array:
'providers' => [ PodPoint\MyUtilityGenius\Providers\ServiceProvider::class ]
Then publish the config file:
php artisan vendor:publish --provider="PodPoint\MyUtilityGenius\Providers\ServiceProvider"
Finally, remember to set MUG_CLIENT_ID
and MUG_CLIENT_SECRET
in your env file.
Manually
You can also manually create a Client by passing in a Config object and optionally setting a token persistence class:
$config = new Config('client-id', 'client-secret'); $config->setTokenPersistence(new FileTokenPersistence('test.db')); $client = new Client($config);
Usage
You can then use the client to make authenticated requests to the API:
$response = $client->json($client->get('request/Address/Postcode/Ready', [ 'query' => ['Postcode' => 'EC1 7YH'] ]));