hampel/synergy-wholesale-laravel

Synergy Wholesale API wrapper using SoapClient and packaged as a Laravel service provider

1.10.0 2023-06-05 04:36 UTC

This package is auto-updated.

Last update: 2024-11-14 07:32:49 UTC


README

Latest Version on Packagist Total Downloads Open Issues License

Synergy Wholesale API wrapper using SoapClient and packaged as a Laravel service provider

By Simon Hampel

This package provides a simple Laravel service provider and facade for our base Synergy Wholesale API wrapper package hampel/synergy-wholesale - please refer to the documentation about that package for instructions on how to use this API wrapper

Installation

To install using composer, run the following command:

composer require hampel/synergy-wholesale-laravel

You must generate an API key using the Synergy Wholesale control panel, which involves adding your web server's IP address to the whitelist - and then specify that key and your reseller ID in your .env file:

SYNERGY_WHOLESALE_API_KEY=your_synergy_wholesale_api_key
SYNERGY_WHOLESALE_RESELLER_ID=your_synergy_wholesale_reseller_id

Upgrading

Upgrading to v1.6 (Laravel v5.8)

In line with changes made in Laravel v5.8, cache expiry times are now specified in seconds rather than minutes. Be sure to adjust the value of all cache entries in the configsynergy-wholesale.cache.*.expiry to suit, if you have over-ridden the defaults.

Usage

Use Laravel's App facade to gain access to the service provider in your code:

use SynergyWholesale\Commands\CheckDomainCommand;

$sw = App::make('SynergyWholesale\SynergyWholesale');
$available = $sw->execute(new CheckDomainCommand(new Domain('example.com')));

... or chain them:

$available = App::make('SynergyWholesale\SynergyWholesale')->execute(new CheckDomainCommand(new Domain('example.com')));

... or just use the Facade instead:

$available = SynergyWholesale::execute(new CheckDomainCommand(new Domain('example.com')));

Refer to the usage examples and code in the Synergy Wholesale API Wrapper repository for more details about how to use the library.