PHPackages                             getkey/licencephp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. getkey/licencephp

ActiveLibrary

getkey/licencephp
=================

getkey is a license management application that can be used by everyone

v1.0.0(1y ago)04MITPHP

Since Aug 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/andre12001/licencephp)[ Packagist](https://packagist.org/packages/getkey/licencephp)[ RSS](/packages/getkey-licencephp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

GetKey PHP API Client Library
=============================

[](#getkey-php-api-client-library)

Support: Framework Laravel, Ci

Introduction
------------

[](#introduction)

The **GetKey PHP API Client Library** allows the integration of various data validation features into your applications. For more information, please visit [getkey.my.id](https://getkey.my.id).

Requirements
------------

[](#requirements)

To use the GetKey API client, you need the following:

- A GetKey account
- An Application project created with a generated API key

Installation
------------

[](#installation)

To begin using the GetKey PHP API Client library, follow these installation steps:

### With Composer

[](#with-composer)

1. Install the library using Composer:

    ```
    composer require getkey/licencephp
    ```
2. Include the Composer autoloader in your PHP script:

    ```
    require_once 'vendor/autoload.php';
    ```

### Without Composer

[](#without-composer)

1. Download the library and add it to your project.
2. Include the file `vendor/autoload.php` in your PHP script:

    ```
    include_once "getkey-licence-api-client/vendor/autoload.php";
    ```

If you experience errors, then try adding this

```
require_once __DIR__ . '../vendor/getkey/licencephp/src/LicenceManager.php';

```

Getting Started
---------------

[](#getting-started)

To start validating and using the API, create a Traits system in your framework. You need to create a licence first on the [getkey.my.id](https://getkey.my.id) site, then you can use the licence name to call the licence API.

### Full Example of License Validation

[](#full-example-of-license-validation)

Create a trait to manage and validate the licence:

```
trait ManagesLicense
{
    protected $licenceManager;
    protected $pemFilePath;

    // Automatically initialize when the trait is used
    public function __construct()
    {
        $this->initializeLicenseManager();
    }

    // Initialize the LicenseManager instance
    protected function initializeLicenseManager($endpoint = null)
    {
        $endpoint = $endpoint ?: config('services.licence.endpoint');
        $this->licenceManager = new LicenseManager($endpoint);
    }

    // Set the PEM file path based on the script name
    protected function setPemFilePath($scriptName)
    {
        $this->pemFilePath = storage_path('licences/' . $scriptName . '.pem');
    }

    // Get the PEM file path
    protected function getPemFilePath()
    {
        return $this->pemFilePath;
    }

    // Combined method to manage and validate the licence
    public function manageAndValidateLicense($scriptName)
    {
        try {
            if (!$this->licenceManager) {
                $this->initializeLicenseManager();
            }

            // Set the PEM file path using the script name
            $this->setPemFilePath($scriptName);
            $pemFilePath = $this->getPemFilePath();

            // Manage the licence (fetch, save, and validate)
            $this->licenceManager->manageLicense($scriptName, $pemFilePath);

            // Validate the PEM file content
            return $this->licenceManager->verifyPemContent($pemFilePath);
        } catch (Exception $e) {
            return $e->getMessage();
        }
    }
}
```

Setting Services
----------------

[](#setting-services)

Add this setting to the service configuration, for example in config/services.php for Laravel:

```
'licence' => [
    'endpoint' => env('LICENCE_ENDPOINT', 'https://getkey.my.id/api/v1/getLicence'),
],
```

Alternatively, you can set it in your .env file:

- LICENCE\_ENDPOINT=

Example of Validation in Controller
-----------------------------------

[](#example-of-validation-in-controller)

```
use App\Traits\ManagesLicense;

class YourController extends Controller
{
    use ManagesLicense;

    public function yourMethod()
    {
        $scriptName = "Licence1";

        // Manage and validate the licence
        $result = $this->manageAndValidateLicense($scriptName);

        if ($result === true) {
            // Logic for successful validation
            return view('welcome');
        } else {
            // Logic for failed validation
            return response()->json(['error' => $result], 500);
        }
    }
}
```

Response Class
--------------

[](#response-class)

The Response class is returned with every request, providing methods to handle responses as detailed in the library documentation.

Testing
-------

[](#testing)

getkey is still in beta stage, and you can try it right now. report any bugs in the class licence or api. please note:

for api endpoints it has not been validated with token, only validated by licencename, but with hashing security... then the licence is used by one user, it cannot be used by two users in one project.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

625d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/58f7aef7ea50c0e91719cd342f92b953f33ac1943222f0ec3401eb613dbf7451?d=identicon)[andre12001](/maintainers/andre12001)

---

Top Contributors

[![andre12001](https://avatars.githubusercontent.com/u/32930152?v=4)](https://github.com/andre12001 "andre12001 (1 commits)")

### Embed Badge

![Health badge](/badges/getkey-licencephp/health.svg)

```
[![Health](https://phpackages.com/badges/getkey-licencephp/health.svg)](https://phpackages.com/packages/getkey-licencephp)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
