Towoo PHP API Client
Simple PHP API client for the Towoo platform.
- Currently just a wrapper around GuzzleHttp with a handy Laravel service provider
Usage
- Add it to your projects dependencies
composer require towoo/towoo
- Use it!
$client = new Towoo\Client\Client($token); // Get token from your Account
$products = $client->get('products');
Using the API with Laravel
- Add the ServiceProvider to your
config/app.php
:
/*
* Package Service Providers...
*/
Towoo\Client\Providers\LaravelServiceProvider::class,
- Add configuration key to
config/services.php
:
'towoo' => [
'token' => env('TOWOO_TOKEN'),
'environment' => env('TOWOO_ENV', 'production')
]
Remember to add TOWOO_TOKEN=
to the .env
file.
- Inject and use the client
use Towoo\Client\Client;
public function products(Client $client)
{
return $client->get('products');
}