PHPackages                             hanzo-asashi/licentra-laravel - 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. hanzo-asashi/licentra-laravel

ActiveLibrary

hanzo-asashi/licentra-laravel
=============================

Official Laravel Client SDK for Licentra — Seamless software license verification, feature flags, RS256 JWT offline validation, auto-updater, and concurrent seat management.

v1.0.0(today)00MITPHPPHP ^8.4CI passing

Since Jul 31Pushed todayCompare

[ Source](https://github.com/hanzo-asashi/licentra-laravel)[ Packagist](https://packagist.org/packages/hanzo-asashi/licentra-laravel)[ Docs](https://github.com/hanzo-asashi/licentra-laravel)[ GitHub Sponsors](https://github.com/licentra)[ RSS](/packages/hanzo-asashi-licentra-laravel/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (13)Versions (2)Used By (0)

Licentra Laravel SDK
====================

[](#licentra-laravel-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a84e5b37c9198789406c0a469a35fd34a06ce8c7b7504144c5e7946e7c4ba6e3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68616e7a6f2d6173617368692f6c6963656e7472612d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hanzo-asashi/licentra-laravel)[![Total Downloads](https://camo.githubusercontent.com/c6fa84806e84cd861a65108c0be918ebe838e0ded8614958ffda2f6cf66194b3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68616e7a6f2d6173617368692f6c6963656e7472612d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hanzo-asashi/licentra-laravel)[![License](https://camo.githubusercontent.com/7b5a548b9c7e99c037ace78824e09c195d5a8d347e6e8baba818583096b5fb74/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f68616e7a6f2d6173617368692f6c6963656e7472612d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

**Licentra Laravel SDK** adalah Client SDK Resmi berbasis Laravel (kompatibel dengan Laravel 11, 12, 13, PHP 8.4+, Filament 3/4/5, &amp; Livewire 3/4) untuk berkomunikasi dengan **Licentra Server** — Platform Manajemen Lisensi Software Perangkat Lunak Enterprise.

---

🚀 Fitur Utama
-------------

[](#-fitur-utama)

- 🛡️ **Verifikasi Tanda Tangan Digital RSA 256-bit (`SHA256withRSA`)**: Memverifikasi enkripsi tanda tangan RSA server pada setiap respons `activate` dan `ping` untuk mencegah serangan *Bypassing / DNS Spoofing*.
- 📑 **Validasi Lisensi Offline (`.lic` File &amp; RS256 JWT)**: Membaca, menguji, dan memverifikasi lisensi *air-gapped* offline (file `.lic` JSON bertanda tangan RSA atau token RS256 JWT) tanpa koneksi internet.
- 🔑 **Hardware ID (HWID) Generator &amp; Reset API**: Generator sidik jari perangkat keras (*machine fingerprint*) otomatis dan metode pengajuan reset HWID (`requestHwidReset`).
- 🎛️ **Feature Flags (Entitlements) &amp; Blade Directives**: Manajemen hak akses modul aplikasi (`hasFeature`), middleware (`licentra.feature:modul`), serta Blade Directive `@hasFeature('modul')`.
- 🔔 **Outbound Webhook Receiver &amp; Laravel Events**: Endpoint webhook bawaan (`POST /licentra/webhook`) bertanda tangan RSA yang otomatis membersihkan cache lokal dan men-dispatch **Laravel Events** (`LicenseRevoked`, `LicenseStatusChanged`, `HwidResetApproved`).
- 💻 **Perintah Artisan CLI Lengkap**: CLI bawaan untuk mengelola lisensi dari terminal: `php artisan licentra:status`, `licentra:activate`, `licentra:clear-cache`, `licentra:health`, dan `licentra:update`.
- 👥 **Concurrent Seats Management &amp; Automatic Logout Listener**: Manajemen alokasi kuota user login bersamaan (`checkInSeat`, `keepSeatAlive`, `checkOutSeat`), dilengkapi listener logout otomatis dan middleware heartbeat (`licentra.seat_alive`).
- 🎨 **Integrasi Filament (v3/v4/v5) &amp; Livewire (v3/v4)**: Komponen Blade siap pakai ``, ``, ``, dan `` dengan dukungan Dark Mode &amp; Filament RenderHooks.
- 🔄 **Automated App Updater Installer (`php artisan licentra:update`)**: Otomatisasi pengunduhan update bertanda tangan digital, *Maintenance Mode*, migrasi database, dan pembersihan cache.
- 🏥 **Health &amp; Network Diagnostic (`php artisan licentra:health`)**: Pengujian diagnostik konektivitas, sertifikasi SSL, Public Key RSA, izin direktori, dan sinkronisasi jam sistem.
- 🔒 **Proteksi Cache Terenkripsi &amp; Anti-Clock-Tampering**: Penyimpanan cache lokal terenkripsi serta proteksi manipulasi jam sistem (clock rewind protection).

---

📦 Instalasi
-----------

[](#-instalasi)

### 1. Instal via Composer

[](#1-instal-via-composer)

```
composer require hanzo-asashi/licentra-laravel
```

Jika repositori berada di VCS privat, tambahkan konfigurasi berikut pada `composer.json` aplikasi Anda:

```
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/hanzo-asashi/licentra-laravel.git"
    }
],
"require": {
    "hanzo-asashi/licentra-laravel": "^1.0"
}
```

### 2. Publish Konfigurasi &amp; Views (Opsional)

[](#2-publish-konfigurasi--views-opsional)

```
php artisan vendor:publish --tag="licentra-laravel-config"
php artisan vendor:publish --tag="licentra-laravel-views"
```

---

⚙️ Konfigurasi `.env`
---------------------

[](#️-konfigurasi-env)

Tambahkan variabel berikut pada file `.env` aplikasi Anda:

```
LICENTRA_URL=https://licentra.test
LICENTRA_LICENSE_KEY=KODE-LISENSI-ANDA
LICENTRA_PRODUCT_SLUG=aquanusa
LICENTRA_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----"
LICENTRA_CACHE_TTL=3600
LICENTRA_GRACE_PERIOD_DAYS=3
LICENTRA_VERIFY_SSL=false
LICENTRA_WEBHOOK_ENABLED=true
LICENTRA_WEBHOOK_PATH=/licentra/webhook
```

Tip

Pada lingkungan pengembangan lokal yang menggunakan **Laravel Herd** / self-signed SSL, atur `LICENTRA_VERIFY_SSL=false` untuk mencegah error cURL 60. Pada server produksi, atur `LICENTRA_VERIFY_SSL=true`.

---

💻 Penggunaan
------------

[](#-penggunaan)

### 1. Aktivasi &amp; Ping Lisensi (Dengan Verification RSA)

[](#1-aktivasi--ping-lisensi-dengan-verification-rsa)

```
use Licentra; // Atau gunakan helper global licentra()

// Aktivasi Lisensi Online (Otomatis mengikat HWID mesin)
$data = Licentra::activate();

// Ping Status Lisensi (Otomatis verifikasi signature & replay-protection nonce)
if (Licentra::ping()) {
    // Lisensi aktif & terverifikasi valid
}
```

### 2. Pengecekan Feature Flags (Entitlements)

[](#2-pengecekan-feature-flags-entitlements)

```
if (licentra()->hasFeature('export_excel')) {
    // Akses modul ekspor Excel diizinkan
}
```

### 3. Validasi Lisensi Offline (.lic File &amp; RS256 JWT)

[](#3-validasi-lisensi-offline-lic-file--rs256-jwt)

```
// Simpan dan baca file offline .lic secara lokal
Licentra::saveOfflineLicense($fileContent);
$offlineData = Licentra::loadOfflineLicense();

// Dekode & verifikasi RS256 JWT Token
$jwtPayload = Licentra::verifyJwt($jwtToken);
```

### 4. Pengajuan Reset Hardware ID (HWID)

[](#4-pengajuan-reset-hardware-id-hwid)

```
Licentra::requestHwidReset('Upgrade motherboard dan processor server');
```

### 5. Concurrent Seats (User Login Bersamaan)

[](#5-concurrent-seats-user-login-bersamaan)

```
// Check-in saat user login
Licentra::checkInSeat(session()->getId(), auth()->user()->email);

// Heartbeat berkala
Licentra::keepSeatAlive(session()->getId());

// Check-out saat user logout (Juga berjalan otomatis via Event Listener Logout)
Licentra::checkOutSeat(session()->getId());
```

### 6. Perintah Artisan CLI

[](#6-perintah-artisan-cli)

```
# Cek status lisensi, validitas, HWID, dan Public Key
php artisan licentra:status

# Jalankan pengujian diagnostik kesehatan koneksi & enkripsi
php artisan licentra:health

# Jalankan pembaruan perangkat lunak otomatis & installer
php artisan licentra:update

# Aktivasi lisensi dari terminal
php artisan licentra:activate AAAA-BBBB-CCCC-DDDD

# Bersihkan cache lisensi lokal
php artisan licentra:clear-cache
```

---

🛡️ Route Middleware &amp; Filament Integration
----------------------------------------------

[](#️-route-middleware--filament-integration)

### A. Penggunaan Route Middleware

[](#a-penggunaan-route-middleware)

Daftarkan middleware pada rute aplikasi Anda:

```
// Memastikan lisensi valid
Route::middleware(['licentra.valid'])->group(function () {
    Route::get('/dashboard', [DashboardController::class, 'index']);
});

// Memastikan fitur spesifik aktif
Route::middleware(['licentra.feature:export_excel'])->group(function () {
    Route::get('/export', [ExportController::class, 'excel']);
});

// Menjaga sesi concurrent seat tetap aktif
Route::middleware(['auth', 'licentra.seat_alive'])->group(function () {
    Route::get('/app', [AppController::class, 'index']);
});
```

### B. Integrasi Filament (v3/v4/v5) &amp; Livewire (v3/v4)

[](#b-integrasi-filament-v3v4v5--livewire-v3v4)

Tampilkan status lisensi atau banner di Filament Admin Panel (`AdminPanelProvider.php`):

```
use Filament\Support\Facades\FilamentView;
use Filament\View\PanelsRenderHook;

public function panel(Panel $panel): Panel
{
    return $panel
        ->renderHook(
            PanelsRenderHook::TOPBAR_BEFORE,
            fn () => view('licentra-laravel::banner')
        );
}
```

Gunakan Komponen Blade di View Filament/Livewire:

```
{{-- Status Badge --}}

{{-- Warning Alert Banner --}}

{{-- Form Aktivasi Lisensi --}}

{{-- Feature Wrapper --}}

```

---

🧪 Testing &amp; Code Quality
----------------------------

[](#-testing--code-quality)

Jalankan test suite Pest, analisis statis PHPStan, dan format kode Pint:

```
# Jalankan Pest Tests
composer test

# Jalankan PHPStan Static Analysis (Level 8)
composer analyse

# Format Kode (Laravel Pint)
composer format
```

---

📄 Lisensi
---------

[](#-lisensi)

Proyek ini berlisensi di bawah [MIT License](LICENSE.md).

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

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

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c099225cf25ba684b61946312e5b7c4443f23c1a23164a31674cfa427e2d59d3?d=identicon)[hansenmakangiras](/maintainers/hansenmakangiras)

---

Top Contributors

[![hanzo-asashi](https://avatars.githubusercontent.com/u/3368565?v=4)](https://github.com/hanzo-asashi "hanzo-asashi (13 commits)")[![hanzo-alpha](https://avatars.githubusercontent.com/u/111342797?v=4)](https://github.com/hanzo-alpha "hanzo-alpha (1 commits)")

---

Tags

laravellaravel-packagefeature-flagssoftware licensinglicentralicense-managemenjwt-rs256auto-updaterrsa-signaturelicentra-laravel

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/hanzo-asashi-licentra-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/hanzo-asashi-licentra-laravel/health.svg)](https://phpackages.com/packages/hanzo-asashi-licentra-laravel)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

88212.7M178](/packages/spatie-laravel-health)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.4M350](/packages/psalm-plugin-laravel)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

24773.9k](/packages/harris21-laravel-fuse)[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M271](/packages/laravel-ai)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

817336.8k3](/packages/defstudio-telegraph)[nativephp/mobile

NativePHP for Mobile

1.1k102.1k118](/packages/nativephp-mobile)

PHPackages © 2026

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