1. Go to this page and download the library: Download bibrokhim/http-clients library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bibrokhim / http-clients example snippets
use Bibrokhim\HttpClients\Clients\PollwonProducts\PollwonProductsClientInterface;
public function index(PollwonProductsClientInterface $client, Request $request)
{
$categories = $client->siteCategories(
$request->query('parent_id'), // null for the root level
$request->header('Accept-Language'),
$request->query('slug'),
);
return response()->json($categories);
}
public function siteCategories(
?string $parentId,
?string $language = null,
?string $slug = null,
): array;
public function siteProducts(array $query = [], ?string $language = null): array;
public function siteProductSearch(array $query = [], ?string $language = null): array;
public function siteProduct(string $productId, ?string $language = null): array;
public function siteSimilarProducts(string $productId, ?string $language = null): array;