License Verification
Package: olakunlevpn/laravel-installer-license
Adds a step that verifies purchase codes via your API.

#Install
composer require olakunlevpn/laravel-installer-license
Done. The step registers automatically.
#Setup your API
The package calls your API to verify licenses.
Set API URL:
.env:
LICENSE_API_URL=https://api.yoursite.com/verify
Your API receives:
{ "license_key": "xxxx-xxxx-xxxx-xxxx", "domain": "customer-site.com"}
Return this for valid licenses:
{ "success": true, "message": "License verified", "data": {}}
Return this for invalid licenses:
{ "success": false, "message": "Invalid license key"}
That's all your API needs to do.
#Database table
The verified license saves to a licenses table.
Create the migration:
php artisan make:migration create_licenses_table
Schema::create('licenses', function (Blueprint $table) { $table->id(); $table->string('license_key'); $table->string('email'); $table->json('data')->nullable(); $table->timestamp('verified_at'); $table->timestamps();});
The package saves data automatically after installation completes.
#Configuration
Only needed if changing defaults.
Publish config:
php artisan vendor:publish --tag=laravel-installer-license-config
Config file (config/installer-license.php):
return [ // Step position (default: 2) 'step_position' => env('LICENSE_STEP_POSITION', 2), // API endpoint 'api_url' => env('LICENSE_API_URL'), // Timeout in seconds (default: 10) 'timeout' => env('LICENSE_API_TIMEOUT', 10), // Skip verification (dev only, default: false) 'skip_verification' => env('LICENSE_SKIP_VERIFICATION', false),];
Environment variables:
LICENSE_STEP_POSITION=2LICENSE_API_URL=https://api.yoursite.com/verifyLICENSE_API_TIMEOUT=10LICENSE_SKIP_VERIFICATION=false
#Customize views
Publish views:
php artisan vendor:publish --tag=laravel-installer-license-views
Edit in resources/views/vendor/license/.
#Translate text
Publish translations:
php artisan vendor:publish --tag=laravel-installer-license-translations
Edit in lang/en/license.php.
#Development mode
Skip API calls during development:
.env:
LICENSE_SKIP_VERIFICATION=true
Never use in production.
#Events
Listen to license events in app/Providers/EventServiceProvider.php:
protected $listen = [ \Olakunlevpn\InstallerLicense\Events\LicenseVerified::class => [ \App\Listeners\SendNotification::class, ], \Olakunlevpn\InstallerLicense\Events\LicenseVerificationFailed::class => [ \App\Listeners\LogFailedAttempt::class, ],];
#Next
- Install Account Setup
- Build your own: Plugin Guide