PHPackages                             ikechukwukalu/requirepin - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. ikechukwukalu/requirepin

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

ikechukwukalu/requirepin
========================

A laravel package for pin confirmation and validation before processing requests to a specified route

v2.0.2(2y ago)24711.4k↑660%17[1 PRs](https://github.com/ikechukwukalu/requirepin/pulls)1MITPHPPHP &gt;=7.3CI failing

Since Mar 3Pushed 1y ago5 watchersCompare

[ Source](https://github.com/ikechukwukalu/requirepin)[ Packagist](https://packagist.org/packages/ikechukwukalu/requirepin)[ RSS](/packages/ikechukwukalu-requirepin/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (10)Dependencies (23)Versions (12)Used By (1)

RequirePin
==========

[](#requirepin)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bbeaeb2d1defcab1d5e80343d9b4f5de7f6f9f1e90d148507cb6ec2846060cba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696b656368756b77756b616c752f7265717569726570696e3f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ikechukwukalu/requirepin)[![Quality Score](https://camo.githubusercontent.com/74dd0d20dd102c022e74f3c122473e53b2dd9a9d3f71626368b36870e4118180/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f696b656368756b77756b616c752f7265717569726570696e2f6d61696e3f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/ikechukwukalu/requirepin/)[![Code Quality](https://camo.githubusercontent.com/e4cbc412e08689986c186e59ad7b2936de8f32d816f85ad172954599778b6f09/68747470733a2f2f696d672e736869656c64732e696f2f636f6465666163746f722f67726164652f6769746875622f696b656368756b77756b616c752f7265717569726570696e3f7374796c653d666c61742d737175617265)](https://www.codefactor.io/repository/github/ikechukwukalu/requirepin)[![Known Vulnerabilities](https://camo.githubusercontent.com/08456f04d340d92eb5d297efbc9f1ba3b84ecd1627858bbbfd22b672af3472df/68747470733a2f2f736e796b2e696f2f746573742f6769746875622f696b656368756b77756b616c752f7265717569726570696e2f62616467652e7376673f7374796c653d666c61742d737175617265)](https://security.snyk.io/package/composer/ikechukwukalu%2Frequirepin)[![Github Workflow Status](https://camo.githubusercontent.com/8192bb91562dc869010250d7b6cad48b6dff84b6ef3428ff3b370bea0ac44924/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f696b656368756b77756b616c752f7265717569726570696e2f7265717569726570696e2e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265)](https://github.com/ikechukwukalu/requirepin/actions/workflows/requirepin.yml)[![Total Downloads](https://camo.githubusercontent.com/b6e61bd62ecd42f57e70bb5ce06f5f1bb06c56fde09d1caee35546917d5c1d94/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696b656368756b77756b616c752f7265717569726570696e3f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ikechukwukalu/requirepin)[![GitHub Repo stars](https://camo.githubusercontent.com/f0ec4273990423765e357593ac677573830bbb8d8e04d212fa3a724611265c20/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f696b656368756b77756b616c752f7265717569726570696e3f7374796c653d666c61742d737175617265)](https://github.com/ikechukwukalu/requirepin/stargazers)[![GitHub issues](https://camo.githubusercontent.com/bf7b5a0d416522672a70a57c35a376d2536a1c5b4c982fe7b3c63e4e60c80ac1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f696b656368756b77756b616c752f7265717569726570696e3f7374796c653d666c61742d737175617265)](https://github.com/ikechukwukalu/requirepin/issues)[![GitHub forks](https://camo.githubusercontent.com/6cb369e5f6739f78eb7a6c2b85e973b90165c4dc2695708c62aae687f8e10b08/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f696b656368756b77756b616c752f7265717569726570696e3f7374796c653d666c61742d737175617265)](https://github.com/ikechukwukalu/requirepin/forks)[![Licence](https://camo.githubusercontent.com/cc3015cfc04c43fe2629d3baa009eeca3cf76040457e0429c916740f6dec15de/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f696b656368756b77756b616c752f7265717569726570696e3f7374796c653d666c61742d737175617265)](https://github.com/ikechukwukalu/requirepin/blob/main/LICENSE.md)

**RequirePin** is a Laravel package that provides middleware to enforce PIN confirmation and validation before processing requests to specified routes, adding an extra layer of security to your application.

Table of Contents
-----------------

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
    - [Applying Middleware](#applying-middleware)
    - [Routes](#routes)
- [Customization](#customization)
    - [Publishing Configuration](#publishing-configuration)
    - [Publishing Language Files](#publishing-language-files)
    - [Publishing Views](#publishing-views)
- [Reserved Keys for Payload](#reserved-keys-for-payload)
- [To Display Return Payload Within Blade](#to-display-return-payload-within-blade)
- [Security Considerations](#security-considerations)
- [Contributing](#contributing)
- [License](#license)

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

[](#requirements)

- PHP 7.3 or higher
- Laravel 8 or higher

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

[](#installation)

To install the package, run the following command:

```
composer require ikechukwukalu/requirepin
```

After installation, publish the migration files:

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

Then, run the migrations:

```
php artisan migrate
```

Configure your `.env` file to use Redis for queue management:

```
REDIS_CLIENT=predis
QUEUE_CONNECTION=redis
```

Finally, start the queue worker:

```
php artisan queue:work
```

Configuration
-------------

[](#configuration)

**RequirePin** uses Redis to manage PIN confirmation queues efficiently. Ensure that your Redis server is properly configured and running.

Usage
-----

[](#usage)

### Applying Middleware

[](#applying-middleware)

To enforce PIN confirmation on specific routes, apply the `require.pin` middleware to those routes or route groups. For example:

```
Route::middleware(['require.pin'])->group(function () {
    // Protected routes
});
```

### Routes

[](#routes)

The package provides the following routes:

**API Routes:**

- `POST api/change/pin`: Endpoint to change the user's PIN.
- `POST api/pin/required/{uuid}`: Endpoint to confirm the PIN for a specific request.

**Web Routes:**

- `POST change/pin`: Endpoint to change the user's PIN.
- `POST pin/required/{uuid}`: Endpoint to confirm the PIN for a specific request.
- `GET change/pin`: Page to display the form for changing the PIN.
- `GET pin/required/{uuid?}`: Page to display the form for PIN confirmation.

**Note:** To receive JSON responses, add the `'Accept: application/json'` header to your requests.

Reserved Keys for Payload
-------------------------

[](#reserved-keys-for-payload)

The following keys are reserved for use within the payload:

- `uuid` - Unique identifier for the PIN request.
- `pin` - The PIN value submitted by the user.
- `expires` - Expiration time for the PIN request.
- `signature` - Timestamp indicating when the PIN was verified.
- `return_payload`
- `pin_validation`

Ensure these keys are not overridden when handling the payload.

To Display Return Payload Within Blade
--------------------------------------

[](#to-display-return-payload-within-blade)

To display the returned payload values within a Blade template, use:

```
@if (session('return_payload'))
    @php
        [$status, $status_code, $data] = json_decode(session('return_payload'), true);
    @endphp

        {!! $data['message'] !!}

@endif
```

You can customize this based on your application's needs.

Security Considerations
-----------------------

[](#security-considerations)

- **PIN Policies:** Ensure that your application enforces strong PIN policies, such as minimum length and complexity requirements.
- **Rate Limiting:** Implement rate limiting on PIN confirmation endpoints to prevent brute-force attacks.
- **Secure Storage:** Store PINs securely using appropriate hashing algorithms.

Contributing
------------

[](#contributing)

Contributions are welcome! Please read the [contribution guidelines](CONTRIBUTING.md) before submitting a pull request.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.9% 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 ~52 days

Recently: every ~68 days

Total

10

Last Release

747d ago

Major Versions

v1.0.6 → v2.0.02024-06-17

PHP version history (2 changes)v1.0.0PHP &gt;=8.0

v1.0.6PHP &gt;=7.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/160470701?v=4)[ikay007](/maintainers/ikay007)[@Ikay007](https://github.com/Ikay007)

---

Top Contributors

[![monitecture](https://avatars.githubusercontent.com/u/100952206?v=4)](https://github.com/monitecture "monitecture (73 commits)")[![ikechukwukalu](https://avatars.githubusercontent.com/u/60310041?v=4)](https://github.com/ikechukwukalu "ikechukwukalu (7 commits)")[![syofyanzuhad](https://avatars.githubusercontent.com/u/52684582?v=4)](https://github.com/syofyanzuhad "syofyanzuhad (3 commits)")[![HosomiKai](https://avatars.githubusercontent.com/u/5814018?v=4)](https://github.com/HosomiKai "HosomiKai (2 commits)")[![nowodev](https://avatars.githubusercontent.com/u/43044740?v=4)](https://github.com/nowodev "nowodev (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ikechukwukalu-requirepin/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k20](/packages/fleetbase-core-api)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k29.9M148](/packages/laravel-cashier)

PHPackages © 2026

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