PHPackages                             tetracode/ncoder - 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. [Security](/categories/security)
4. /
5. tetracode/ncoder

ActiveLibrary[Security](/categories/security)

tetracode/ncoder
================

laravel api encryption middleware by Tetracode

v1.0.2(5y ago)0703[3 PRs](https://github.com/avgkudey/laravel-ncoder/pulls)MITPHP

Since Apr 7Pushed 3y agoCompare

[ Source](https://github.com/avgkudey/laravel-ncoder)[ Packagist](https://packagist.org/packages/tetracode/ncoder)[ RSS](/packages/tetracode-ncoder/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (7)Used By (0)

Laravel API Encryption Package
==============================

[](#laravel-api-encryption-package)

[![Total Downloads](https://camo.githubusercontent.com/9e2a37270bf904c9f55856e5fc9198fc74270081ff3af2f8bface0de104dcbbf/68747470733a2f2f706f7365722e707567782e6f72672f7465747261636f64652f6e636f6465722f646f776e6c6f616473)](https://packagist.org/packages/tetracode/ncoder)[![Latest Stable Version](https://camo.githubusercontent.com/c14d278391fcf5cb7bfbf80d24e1018207eb635fc25e7328502729a6a28857a4/68747470733a2f2f706f7365722e707567782e6f72672f7465747261636f64652f6e636f6465722f762f737461626c65)](https://packagist.org/packages/tetracode/ncoder)[![Latest Unstable Version](https://camo.githubusercontent.com/b1af56f85802cdc6b4df346a2a0dc79c1cca620deac2a9ab4e1ea424c2273c85/68747470733a2f2f706f7365722e707567782e6f72672f7465747261636f64652f6e636f6465722f762f756e737461626c65)](https://packagist.org/packages/tetracode/ncoder)[![License](https://camo.githubusercontent.com/c01cc35f67927609df598f782aa3195cd039cb6144e5be3b6dfc572b51986e98/68747470733a2f2f706f7365722e707567782e6f72672f7465747261636f64652f6e636f6465722f6c6963656e7365)](https://packagist.org/packages/tetracode/ncoder)

Ncoder is a simple API call encryption middleware package designed to work on laravel Framework.

### Installing Ncoder

[](#installing-ncoder)

install trough [Composer](https://getcomposer.org/).

```
composer require tetracode/ncoder
```

### Configuration

[](#configuration)

- #### Register Service Provider

    [](#register-service-provider)

Above Laravel 5.5 or higher no need to add service provider

if you are using laravel 5.4 or below add service provider to Config/app.php providers array

```
'providers' => [
  Tetracode\Ncoder\NcoderBaseServiceProvider::class,
 ],
```

- #### Register Middleware

    [](#register-middleware)

Add Ncoder middleware to routeMiddleware array in App/Http/Kernel.php

```
 protected $routeMiddleware = [

 'ncoder'=>\Tetracode\Ncoder\Http\Middleware\EncryptHttp::class,
 'xncoder'=>\Tetracode\Ncoder\Http\Middleware\ForceEncryptHttp::class,
 ]
```

- #### Publishing Config file

    [](#publishing-config-file)

```
php artisan vendor:publish --tag ncoder-config
```

- #### Generate Secret Key

    [](#generate-secret-key)

```
php artisan ncoder:secret
```

### Middleware Types

[](#middleware-types)

**ncoder :** this will encrypt response only requested in front end. **xncoder :** this will encrypt response no matter requested in front end or not.

### Usage

[](#usage)

Route

```
Route::middleware('ncoder')->post('api-endpoint', 'ApiController@store');

//Force Encrypt Response
Route::middleware('xncoder')->post('api-endpoint', 'ApiController@store');

Route::group(['middleware' => ['ncoder']], function () {
   Route::post('api-endpoint', 'ApiController@store');
});

//Force Encrypt Response
Route::group(['middleware' => ['xncoder']], function () {
   Route::post('api-endpoint', 'ApiController@store');
});
```

Controller

```
class UserController extends Controller {

    public function __construct() {
        $this->middleware(['ncoder']);
    }

    public function index() {
         return response()->json(User::all());
    }
}
```

OR

```
class UserController extends Controller {

    public function __construct() {
        $this->middleware(['xncoder']);
    }

    public function index() {
        return response()->json(User::all());
    }
}
```

Credits
-------

[](#credits)

- [Contributors](https://github.com/avgkudey/laravel-ncoder/graphs/contributors)

Vue Package
-----------

[](#vue-package)

- [Vue Ncoder](https://github.com/avgkudey/laravel-ncoder)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENCE) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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

Every ~27 days

Total

3

Last Release

2177d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5a19ef3eb79c1e44ed27056799226b393d6cf4e5cf2592200c836cd03450514d?d=identicon)[avgkudey](/maintainers/avgkudey)

---

Top Contributors

[![avgkudey](https://avatars.githubusercontent.com/u/40860028?v=4)](https://github.com/avgkudey "avgkudey (16 commits)")

### Embed Badge

![Health badge](/badges/tetracode-ncoder/health.svg)

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

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[illuminate/encryption

The Illuminate Encryption package.

9229.7M280](/packages/illuminate-encryption)

PHPackages © 2026

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