devwebs01 / gh-license
Simple licensing client for Laravel applications - license validation, device fingerprinting, offline grace period, and feature flags.
v1.1.0
2026-05-26 19:28 UTC
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.0
- laravel/framework: ^10.0 || ^11.0 || ^12.0 || ^13.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.0
- mockery/mockery: ^1.6
- orchestra/testbench: ^8.0 || ^9.0 || ^10.0 || ^11.0
- phpunit/phpunit: ^10.0 || ^11.0
README
Package: devwebs01/gh-license
Version: 1.1.0
Architecture: GitHub Raw JSON Sync — no API server required.
Installation
composer require devwebs01/gh-license
Configuration
LICENSING_GITHUB_RAW=https://raw.githubusercontent.com/owner/repo/main LICENSING_KEY=XXXX-XXXX-XXXX-XXXX LICENSING_GRACE_DAYS=7 LICENSING_ADMIN_CONTACT=admin@company.com LICENSING_APP_NAME=MyApp LICENSING_CACHE_STORE=file LICENSING_CACHE_TTL=3600 LICENSING_SYNC_INTERVAL=12 LICENSING_DEV_BYPASS=false LICENSING_HMAC_SECRET=
Note: The server pushes
max_devices,features, andupdated_atfields to GitHub.
The client enforcesmax_deviceslocally (showsdeviceLimitReachedflag) and exposesfeaturesfor feature flag checks.
Commands
php artisan license:activate XXXX-XXXX-XXXX-XXXX php artisan license:status php artisan license:sync php artisan license:check
Quick Start
- Set
LICENSING_GITHUB_RAWto your GitHub raw content base URL - Set
LICENSING_KEYto the license key - Run
php artisan license:activate {key} - Add
->middleware('license')to protected routes
How It Works
- License Monitor pushes JSON status files to GitHub (includes
max_devices,features,expires_at,status) - Client fetches from
https://raw.githubusercontent.com/.../licenses/{hash}.json - Status is cached locally with offline grace period and HMAC integrity check
- Server sync runs on Artisan schedule; stale cache auto-refresh on critical operations
license:statusdisplays all enriched fields;license_info()andlicense_is_valid()helpers available
Testing
vendor/bin/phpunit