n0izestr3am / license-server
"License/Serial for web apllication"
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:package
Requires
- php: ^7.2|^8.0
- ext-json: *
- irfa/php-sn-generator: ^1.0
- laravel/framework: ^6.0|^8.0
This package is auto-updated.
Last update: 2024-12-28 06:08:57 UTC
README
This package based on app-license-server for Laravel package.
composer require n0izestr3am/license-server
🛠️ Laravel Setup
Add to config/app.php
'providers' => [
....
n0izestr3am\AppLicenseServer\AppLicenseServerServiceProvider::class,
];
Add to config/app.php
'aliases' => [
....
'ALS' => n0izestr3am\AppLicenseServer\Facades\AppLicenseServer::class,
],
Publish Vendor
php artisan vendor:publish --tag=app-license-server
Run Migration
php artisan migrate --path=vendor/n0izestr3am/license-server/migrations
Config File
config/n0izestr3am/app_license_server.php
Inside Config File
<?php return [ 'license_route' => '/check/license', 'route_name' => 'check_license', 'char_type' => 'alphanumeric', //Type alphanumeric,numeric,or alphabet 'length' => 4,//default : 4 'segment' => 4,//default : 4 'striped' => true,//default : true ];
Register New Serial Number License
<?php namespace App\Http\Controllers; use ALS; use Illuminate\Http\Request; use App\Http\Controllers\Controller; class LicenseController extends Controller { public function register(Request $request) { return ALS::register(['name'=>"Lorem", 'domain'=>"example.com", 'phone_number'=>"08123123", 'address'=>"Bandung,Indonesia"],now()->addDays(30)); } }
Check License
<?php namespace App\Http\Controllers; use ALS; use Illuminate\Http\Request; use App\Http\Controllers\Controller; class LicenseController extends Controller { public function check(Request $request) { return ALS::serial($request->serial)->check(); } }
Disabled Serial number
ALS::serial($request->serial)->disabled();
Enabled serial number
ALS::serial($request->serial)->disabled();