towoo/towoo

Official PHP API client for the Towoo platform


Keywords
api, composer, php, towoo
License
MIT

Documentation

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

  1. Add it to your projects dependencies
composer require towoo/towoo
  1. Use it!
$client = new Towoo\Client\Client($token); // Get token from your Account
$products = $client->get('products');

Using the API with Laravel

  1. Add the ServiceProvider to your config/app.php:
/*
 * Package Service Providers...
 */
Towoo\Client\Providers\LaravelServiceProvider::class,
  1. 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.

  1. Inject and use the client
use Towoo\Client\Client;

public function products(Client $client)
{
    return $client->get('products');
}