Semantic Versioning and git-flow are used.
Please create pull-requests against the develop
-branch.
composer require naugrim/wortmann-soap-api
The package gets auto-discovered. Set WORTMANN_SOAP_API_USERNAME
and WORTMANN_SOAP_API_PASSWORD
in your .env
.
Optional: Publish the config files with:
php artisan vendor:publish --provider='Naugrim\WortmannSoapApi\Provider\WortmannSoapApiProv'
An instance of the API client can be injected into your Controller (for example):
<?php
use Naugrim\WortmannSoapApi\Client\Type\GetStockAndPriceInformationByProductIds;
use Naugrim\WortmannSoapApi\Contracts\WortmannSoapApi;
class MyController {
/**
* @var WortmannSoapApi
*/
protected $client;
/**
* @param WortmannSoapApi $client
*/
public function __construct(WortmannSoapApi $client)
{
$this->client = $client;
}
public function getStockInformation(array $productIds)
{
$response = $this->client->request(
GetStockAndPriceInformationByProductIds::class,
[6466010, 6466011]
);
// do something with the response
dump($response->entry());
}
}
See demo/index.php
.