PHP code example of farhadhp / zhaket-guard

1. Go to this page and download the library: Download farhadhp/zhaket-guard 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/ */

    

farhadhp / zhaket-guard example snippets




$productToken = 'f2352e4a-4545-4c86-8790-454545'; // توکن محصول شما
$license = 'f2352e4a-82c8-4c86-8790-23234323'; // لایسنس وارد شده توسط کاربر

$res = ZhaketGuard::installLicense($productToken, $license);

if ($res->status=='successful') {
    // Lisence successfuly installed
    echo $res->message;
} else {
    // License not installed / show message
    if (!is_object($res->message)) {
        echo $res->message;
    } else {
        foreach ($res->message as $message) {
            foreach ($message as $msg) {
                echo $msg.'<br>';
            }
        }
    }
}

$license = 'f2352e4a-82c8-4c86-8790-23234323'; // لایسنس وارد شده توسط کاربر

$res = ZhaketGuard::isValidLicense($license);

if ($res->status=='successful') {
    // Lisence is valid
    echo $res->message;
} else {
    // License not valid
    // show errors
    if (!is_object($res->message)) {
        echo $res->message;
    } else {
        foreach ($res->message as $message) {
            foreach ($message as $msg) {
                echo $msg.'<br>';
            }
        }
    }
}