PHP code example of lamine / license

1. Go to this page and download the library: Download lamine/license library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lamine / license example snippets


Route::get('/', function () {

    if (Index::validateLicense()) {
        return view('welcome');
    } else {
        return view('License::LicenseExpired');
    }
})->name('home');

public function index()
{
    if (Index::validateLicense()) {
        return Inertia::render('Auth/Login');
    } else {
        return view('License::LicenseExpired');
    }
}

protected $routeMiddleware = [
        .
        .
        .
        'license-api' => \Lamine\License\Middleware\ApiWare::class,
        'license-web' => \Lamine\License\Middleware\WebWare::class,
    ];

Route::group(['middleware' => ['license-web']], function () {
    // all your web routes here
});

Route::group(['middleware' => ['license-api']], function () {
    // all your api routes here
});

// check license every week
$schedule->call([Index::class, 'checkLicense'])->weekly();

// check time every hour
$schedule->call(function () {
    app()->call([TimeChecker::class, 'checkTime']);
})->hourly();

// truncate timestamps table every 24 hours
$schedule->call(function () {
    TimeChecker::truncateTimestamps();
})->daily();
bash
COMPANY_URL="https://www.yourwebsite.com/"
COMPANY_NAME="Your Company Name"
COMPANY_MAIL="[email protected]"
COMPANY_PHONE="+212 6 00 00 00 00"
bash
php artisan migrate
bash
php artisan schedule:work
bash
php artisan serve