composer require theshopdev/api-client
- Add
\Theshop\ApiClient\ApiClientServiceProvider::class
toconfig/app.php
providers. - Fill .env values:
THESHOP_API_KEY=
THESHOP_API_ENDPOINT=
THESHOP_CATALOG=
For single request:
$data = $this->getConnector()->send(new ProductListRequest(
limit: 8,
offset: 0
))->data;
For multiple async requests:
$data = $this->getConnector()->sendMultiple([
'pages' => new ProductListRequest(
limit: 8,
offset: 0
),
'categories' => new ProductListRequest(
limit: 8,
offset: 0
)
]);