PHPackages                             ucubix/laravel-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. ucubix/laravel-client

ActiveLibrary[API Development](/categories/api)

ucubix/laravel-client
=====================

Laravel wrapper for the UCubix Distribution API PHP Client

v1.0.0(2mo ago)04MITPHPPHP ^8.2

Since Apr 9Pushed 1w agoCompare

[ Source](https://github.com/a2zwebltd/ucubix-laravel-client)[ Packagist](https://packagist.org/packages/ucubix/laravel-client)[ RSS](/packages/ucubix-laravel-client/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (5)Versions (2)Used By (0)

UCubix Laravel Client
=====================

[](#ucubix-laravel-client)

Laravel wrapper for the [UCubix PHP Client](https://github.com/a2zwebltd/ucubix-php-client) — provides a service provider, facade, and config file for seamless Laravel integration. No duplicated business logic.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 10, 11, 12, or 13

Installation
------------

[](#installation)

```
composer require ucubix/laravel-client
```

The service provider and facade are auto-discovered. No manual registration needed.

Configuration
-------------

[](#configuration)

Publish the config file:

```
php artisan vendor:publish --tag=ucubix-config
```

This creates `config/ucubix.php`. All settings are configurable via environment variables:

```
UCUBIX_API_KEY=your-api-key
UCUBIX_BASE_URL=https://ucubix.com/api/v1/
UCUBIX_MAX_RETRY=3
```

KeyEnv VariableDefaultDescription`api_key``UCUBIX_API_KEY``''`Bearer token for API authentication`base_url``UCUBIX_BASE_URL``https://ucubix.com/api/v1/`API base URL`max_retry_on_rate_limit``UCUBIX_MAX_RETRY``3`Max retries on 429 responsesQuick Start
-----------

[](#quick-start)

```
use Ucubix\LaravelClient\Facades\Ucubix;

// Get organisation info
$org = Ucubix::getOrganisation();
echo $org->name;

// Search products
$products = Ucubix::getProducts(['search' => 'Cyberpunk']);
foreach ($products->data as $product) {
    echo "{$product->name} ({$product->type})\n";
}

// Get single product with pricing
$product = Ucubix::getProduct('product-uuid');
foreach ($product->regional_pricing as $region) {
    echo "{$region->region_code}: {$region->reseller_wsp} WSP\n";
}

// Create order
$order = Ucubix::createOrder('product-uuid', 1, 'EU', 'DE');
echo "Order {$order->code} — {$order->status}\n";

// Get license keys
$items = Ucubix::getOrderItems($order->id);
foreach ($items->data as $item) {
    if ($item->hasLicenseKey()) {
        $key = Ucubix::getLicenseKey($item->license_key_uuid);
        echo "Key: {$key->license_key}\n";
    }
}
```

Dependency Injection
--------------------

[](#dependency-injection)

```
use Ucubix\PhpClient\Client\UcubixClient;

class ProductController extends Controller
{
    public function index(UcubixClient $client)
    {
        $products = $client->getProducts(page: 1, perPage: 50);

        return response()->json($products->toArray());
    }
}
```

The `UcubixClient` is registered as a singleton — the same instance is reused across the request lifecycle.

Facade Reference
----------------

[](#facade-reference)

The `Ucubix` facade proxies all methods directly to `UcubixClient`. All DTOs extend `Spatie\LaravelData\Data` and support `toArray()`, `toJson()`, etc.

### Organisation

[](#organisation)

MethodReturns`Ucubix::getOrganisation()``Organisation`### Products

[](#products)

MethodReturns`Ucubix::getProducts(filters, page, perPage, sort)``PaginatedResponse``Ucubix::getProduct(id)``Product``Ucubix::getProductPhotos(id, page, perPage)``PaginatedResponse``Ucubix::getProductScreenshots(id, page, perPage)``PaginatedResponse``Ucubix::getProductCategories(id, page, perPage)``PaginatedResponse``Ucubix::getProductPublishers(id, page, perPage)``PaginatedResponse``Ucubix::getProductPlatforms(id, page, perPage)``PaginatedResponse``Ucubix::getProductFranchises(id, page, perPage)``PaginatedResponse``Ucubix::getProductDevelopers(id, page, perPage)``PaginatedResponse`**Product filters:** `search`, `category`, `publisher`, `developer`, `franchise`, `platform`

### Orders

[](#orders)

MethodReturns`Ucubix::getOrders(filters, page, perPage, sort)``PaginatedResponse``Ucubix::getOrder(id)``Order``Ucubix::getOrderItems(orderId, page, perPage)``PaginatedResponse``Ucubix::createOrder(productUuid, quantity, regionCode, countryCode?)``Order``Ucubix::updateOrder(id, quantity)``Order``Ucubix::cancelOrder(id)``bool`**Order filters:** `code`, `external_reference`

### License Keys

[](#license-keys)

MethodReturns`Ucubix::getLicenseKey(id)``LicenseKey``Ucubix::getBulkLicenseKeys(ids)``LicenseKey[]`### Catalog Dictionaries

[](#catalog-dictionaries)

MethodReturns`Ucubix::getCategories(page, perPage, sort)``PaginatedResponse``Ucubix::getPublishers(page, perPage, sort)``PaginatedResponse``Ucubix::getPlatforms(page, perPage, sort)``PaginatedResponse``Ucubix::getDevelopers(page, perPage, sort)``PaginatedResponse``Ucubix::getFranchises(page, perPage, sort)``PaginatedResponse`### Rate Limiting

[](#rate-limiting)

MethodReturnsDescription`Ucubix::getRateLimitRemaining()``?int`Server-reported remaining requests`Ucubix::getRateLimitLimit()``?int`Server-reported limit`Ucubix::setMaxRetryOnRateLimit(max)``UcubixClient`Set max 429 retries`Ucubix::getMaxRetryOnRateLimit()``int`Get max 429 retriesPagination
----------

[](#pagination)

All list endpoints return `PaginatedResponse`:

```
$page = 1;
do {
    $products = Ucubix::getProducts(page: $page, perPage: 50);

    foreach ($products->data as $product) {
        // process
    }

    $page++;
} while ($products->hasMorePages());
```

Error Handling
--------------

[](#error-handling)

All exceptions from [ucubix/php-client](https://github.com/a2zwebltd/ucubix-php-client) propagate as-is:

```
use Ucubix\PhpClient\Exceptions\ApiException;
use Ucubix\PhpClient\Exceptions\AuthenticationException;
use Ucubix\PhpClient\Exceptions\RateLimitException;
use Ucubix\PhpClient\Exceptions\ValidationException;

try {
    $order = Ucubix::createOrder($uuid, 5, 'InvalidRegion');
} catch (AuthenticationException $e) {
    // 401/403 — invalid API key or IP not whitelisted
} catch (ValidationException $e) {
    // 422 — validation failed
    echo $e->field;
} catch (RateLimitException $e) {
    // 429 — all retries exhausted
    echo $e->retryAfter;
} catch (ApiException $e) {
    // All other API errors
    echo $e->errorDetail;
}
```

Rate Limiting
-------------

[](#rate-limiting-1)

The underlying PHP client has a dual-layer rate limiting system:

1. **Client-side sliding window** — proactive throttling (default: 100 req/min)
2. **Server-side 429 retry** — reactive, respects `Retry-After` header (default: 3 retries)

The `UCUBIX_MAX_RETRY` config controls the retry count. The sliding window adapts automatically if the server reports a higher limit.

For full rate limiting documentation, see [ucubix/php-client](https://github.com/a2zwebltd/ucubix-php-client#rate-limiting).

DTOs
----

[](#dtos)

All DTOs are from `ucubix/php-client` and extend `Spatie\LaravelData\Data`:

```
$product = Ucubix::getProduct('uuid');

$product->toArray();  // array
$product->toJson();   // JSON string

// Works seamlessly in responses
return response()->json($product);
```

For full DTO documentation, see [ucubix/php-client DTOs](https://github.com/a2zwebltd/ucubix-php-client#dtos).

Testing
-------

[](#testing)

```
composer install
vendor/bin/phpunit
```

License
-------

[](#license)

MIT. See [LICENSE](LICENSE).

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance94

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

61d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2b500dd3d9b470b50b1ed911cd24a6fdcce51dd97dceb4f97879f727a14495a8?d=identicon)[dawid-makowski](/maintainers/dawid-makowski)

![](https://www.gravatar.com/avatar/9d92cd9be3f984a45cbdba6721edf633e02a6e3ec16b684cb857f173db1c5f89?d=identicon)[PavelDenisovDev](/maintainers/PavelDenisovDev)

---

Top Contributors

[![nikita-a2zweb](https://avatars.githubusercontent.com/u/201099482?v=4)](https://github.com/nikita-a2zweb "nikita-a2zweb (1 commits)")[![PavelDenisovDev](https://avatars.githubusercontent.com/u/110802437?v=4)](https://github.com/PavelDenisovDev "PavelDenisovDev (1 commits)")

---

Tags

apiclientlaravellicensedistributiondigitalucubix

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ucubix-laravel-client/health.svg)

```
[![Health](https://phpackages.com/badges/ucubix-laravel-client/health.svg)](https://phpackages.com/packages/ucubix-laravel-client)
```

###  Alternatives

[resend/resend-laravel

Resend for Laravel

1212.2M8](/packages/resend-resend-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
