PHPackages                             ekeng/nid - 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. [API Development](/categories/api)
4. /
5. ekeng/nid

ActiveLibrary[API Development](/categories/api)

ekeng/nid
=========

Laravel package for nid integration

025PHP

Since Feb 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Nakturnal79/nid)[ Packagist](https://packagist.org/packages/ekeng/nid)[ RSS](/packages/ekeng-nid/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

NidAPI Package for Laravel
==========================

[](#nidapi-package-for-laravel)

This package provides an easy integration of the National Identification API (NIDAPI) for Laravel applications. It simplifies the process of authenticating users and interacting with the NIDAPI endpoints.

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

[](#requirements)

- **PHP**: &gt;= 7.3
- **Laravel**: 8.x, 9.x, or higher

Features
--------

[](#features)

- Easy integration with the National Identification API (NIDAPI)
- Supports OAuth2 authentication
- Fetch user data using access tokens

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

[](#installation)

### Step 1: Install the Package

[](#step-1-install-the-package)

You can install this package via Composer. Add the following line to your `composer.json` file in the `require` section or run the command below:

```
composer require ekeng/nid
```

Step 2: Publish the Migrations

After installing the package, you will need to publish the migrations:

```
php artisan vendor:publish --tag=migrations
```

Step 3: Run the Migrations

Once the migrations are published, run the migration command:

```
php artisan migrate
```

Step 4: Configure Environment Variables

Add the following variables to your .env file, which will be used to connect with the NIDAPI:

NID\_CLIENT\_ID=your-client-id
NID\_CLIENT\_SECRET=your-client-secret
NID\_BASE\_URI=
NID\_AUTH\_URI=auth
NID\_TOKEN\_URI=

Step 5: Add the Service Provider (if needed)

If you are using Laravel's auto-discovery feature, this step can be skipped. However, if you're using an older version of Laravel or auto-discovery doesn’t work, manually add the service provider in the config/app.php file:

```
'providers' => [
    Ekeng\Nid\NidServiceProvider::class,
],

```

Step 6: Using the API in Your Application

To use the NID API in your Laravel application, inject the NidAPI class into your controller or service and create new Instance of NidAPI:

```
$nidApi = new NidAPI($client_id, $client_secret, $base_url, $auth_uri, $token_uri);

```

Step 7: Callback URL Create callback url and name it "nid\_callback" like example below

```
 Route::get('/nid/callback', [\App\Http\Controllers\LoginController::class,'auth'])->name('nid_callback');

```

Step 8: Available Methods in NidAPI

generateRedirectUrl(): This method generates a URL for redirecting users to the NID authorization page. This method accept one parameter

$lang - language path of website (optional)

Example usage:

```
$redirectUrl = $nidApi->generateAuthRedirectUrl($lang);

```

getUserDetails($request): This method retrieves user data (available after redirecting to back url).

Example usage:

```
$userData = $nidApi->getUserDetails($request);

```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity16

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6819d8223558702b842d1027ee91e12e3eeff39f67252329dc70de47ca7eb877?d=identicon)[Nakturnal](/maintainers/Nakturnal)

---

Top Contributors

[![Nakturnal79](https://avatars.githubusercontent.com/u/24854423?v=4)](https://github.com/Nakturnal79 "Nakturnal79 (6 commits)")

### Embed Badge

![Health badge](/badges/ekeng-nid/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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