PHPackages                             finatto/license-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. finatto/license-client

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

finatto/license-client
======================

03PHP

Since May 21Pushed 2w agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

finatto/license-client
======================

[](#finattolicense-client)

Cliente Laravel para a **Finatto License Manager**. Recebe as credenciais de cada tenant em tempo de execução e expõe uma API tipada, escondendo HTTP, tokens e cache da aplicação consumidora.

```
use Finatto\LicenseClient\Facades\License;

$license = License::for($tenant->serial_key, $tenant->cnpj);

if (! $license->hasModule('fleet')) {
    abort(403);
}
```

> As credenciais pertencem à aplicação (uma por tenant, persistidas onde o cliente decidir) — o pacote apenas as transporta.

Instalação
----------

[](#instalação)

```
composer require finatto/license-client
php artisan vendor:publish --tag=license-client-config
```

Auto-discovery registra o provider e a Facade `License`.

### Configuração (`.env`)

[](#configuração-env)

```
LICENSE_MANAGER_URL=https://license.test

# opcionais
LICENSE_HTTP_TIMEOUT=10
LICENSE_HTTP_RETRY_TIMES=2
LICENSE_TOKEN_LEEWAY=60
LICENSE_SNAPSHOT_TTL=300
LICENSE_CACHE_STORE=
```

Uso
---

[](#uso)

### Por tenant

[](#por-tenant)

```
use Finatto\LicenseClient\Facades\License;

$license = License::for($tenant->serial_key, $tenant->cnpj);

$license->snapshot();             // cacheado por LICENSE_SNAPSHOT_TTL
$license->fresh();                // ignora o cache
$license->isActive();
$license->hasModule('checklist');
$license->token();
$license->flush();

$snapshot = $license->snapshot();
$snapshot->tenant->legalName;
$snapshot->subscription?->plan?->maxVehicles;
$snapshot->moduleCodes();
```

### Tenant atual via resolver

[](#tenant-atual-via-resolver)

```
use Finatto\LicenseClient\Data\LicenseCredentials;
use Finatto\LicenseClient\Facades\License;

License::resolveUsing(fn () => LicenseCredentials::make(
    serialKey: CurrentTenant::get()->serial_key,
    document:  CurrentTenant::get()->cnpj,
));

License::hasModule('fleet');
License::snapshot();
```

Erros
-----

[](#erros)

Todas as exceções estendem `LicenseClientException`:

Exceção`InvalidSerialKeyException`serial key ausente ou inválida`AuthenticationException`falha ao autenticar — expõe `->oauthError` e `->status``LicenseRequestException`falha ao consultar a licença — expõe `->status`Análise estática
----------------

[](#análise-estática)

```
composer install
vendor/bin/phpstan analyse
```

Licença
-------

[](#licença)

Proprietário

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance63

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/76708535?v=4)[Cesar Bosqueiro](/maintainers/cesarbosqueiro)[@cesarbosqueiro](https://github.com/cesarbosqueiro)

---

Top Contributors

[![cesarbosqueiro](https://avatars.githubusercontent.com/u/76708535?v=4)](https://github.com/cesarbosqueiro "cesarbosqueiro (2 commits)")

### Embed Badge

![Health badge](/badges/finatto-license-client/health.svg)

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

###  Alternatives

[rainlab/blog-plugin

Blog plugin for October CMS

17158.6k](/packages/rainlab-blog-plugin)[bruli/php-value-objects

PHP Value objects to use for DDD domains.

43321.3k8](/packages/bruli-php-value-objects)

PHPackages © 2026

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