akira / laravel-licence-api
RESTful API package for laravel-license-core. Provides complete API endpoints for license validation, activation, usage tracking, and management.
Fund package maintenance!
kidiatoliny
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 1
pkg:composer/akira/laravel-licence-api
Requires
- php: ^8.4
- akira/laravel-license-core: ^1.0
- illuminate/contracts: ^12.0
- spatie/laravel-package-tools: ^1.16
- spatie/laravel-route-attributes: *
Requires (Dev)
- akira/laravel-debugger: ^1.0
- driftingly/rector-laravel: ^2.1
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^10.0|^11.0
- peckphp/peck: ^0.2
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- pestphp/pest-plugin-type-coverage: ^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- rector/rector: ^2.2
This package is auto-updated.
Last update: 2025-11-28 19:10:57 UTC
README
RESTful API package for laravel-license-core. This package provides complete API endpoints for license validation, activation, usage tracking, and management.
Features
- License listing and retrieval
- License validation by key
- License activation management
- Full REST API with proper HTTP status codes
- Laravel Sanctum ready for authentication
- Comprehensive API Resources for clean JSON responses
- Form Request validation for all endpoints
- Spatie Route Attributes for clean route definitions
Installation
composer require akira/laravel-licence-api
API Endpoints
Licenses
List Licenses
GET /api/v1/licenses
Get License
GET /api/v1/licenses/{id}
Validate License
POST /api/v1/licenses/validate
Content-Type: application/json
{
"key": "LICENSE-KEY"
}
License Activations
List Activations
GET /api/v1/licenses/{license}/activations
Get Activation
GET /api/v1/licenses/{license}/activations/{activation}
Create Activation
POST /api/v1/licenses/{license}/activations
Content-Type: application/json
{
"license_id": 1,
"domain": "example.com",
"machine_hash": "abc123def456",
"ip": "192.168.1.1",
"user_agent": "Mozilla/5.0"
}
Delete Activation
DELETE /api/v1/licenses/{license}/activations/{activation}
Configuration
Publish the configuration file:
php artisan vendor:publish --provider="Akira\LaravelLicenseApi\LaravelLicenseApiServiceProvider"
Configure the API prefix and middleware in config/licence-api.php:
return [ 'prefix' => env('LICENCE_API_PREFIX', 'api/v1'), 'middleware' => ['api'], ];
Testing
Run the test suite:
composer test
Run specific test suites:
composer run test:lint # Code style composer run test:refactor # Rector checks composer run test:types # PHPStan static analysis composer run test:arch # Architecture tests composer run test:coverage # Code coverage
Requirements
- PHP 8.4+
- Laravel 12.0+
- laravel-license-core ^1.0
License
The MIT License (MIT). Please see License File for more information.