PHPackages                             solution-forest/filament-otp-input - 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. solution-forest/filament-otp-input

ActiveLibrary

solution-forest/filament-otp-input
==================================

Otp input for filament

v2.0.2(11mo ago)074MITBladePHP ^8.1CI failing

Since Jan 29Pushed 11mo agoCompare

[ Source](https://github.com/solutionforest/filament-otp-input)[ Packagist](https://packagist.org/packages/solution-forest/filament-otp-input)[ Docs](https://github.com/solutionforest/filament-otp-input)[ RSS](/packages/solution-forest-filament-otp-input/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (13)Versions (13)Used By (0)

Filament One-Time Passcode (OTP) Input Form Component
=====================================================

[](#filament-one-time-passcode-otp-input-form-component)

[![Latest Version on Packagist](https://camo.githubusercontent.com/05e1d6d27de722bf547b62b45d5b898277d3bb95688ea7182425e6df8a4a4b22/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f6c7574696f6e2d666f726573742f66696c616d656e742d6f74702d696e7075742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/solution-forest/filament-otp-input)[![Total Downloads](https://camo.githubusercontent.com/552db63ac0aacf1af9d45a58b5a689cec307eb655f1b58c7e2c2c835dad3f9a3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736f6c7574696f6e2d666f726573742f66696c616d656e742d6f74702d696e7075742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/solution-forest/filament-otp-input)[![PHP from Packagist](https://camo.githubusercontent.com/194f35f2fc077768617f0567a68b9701af212f174b9d8b318516474264719ec9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f736f6c7574696f6e2d666f726573742f66696c616d656e742d6f74702d696e7075743f7374796c653d666c61742d737175617265)](https://packagist.org/packages/solution-forest/filament-otp-input)[![Tests](https://github.com/solutionforest/filament-otp-input/workflows/Tests/badge.svg?style=flat-square)](https://github.com/solutionforest/filament-otp-input/workflows/Tests/badge.svg?style=flat-square)[![License](https://camo.githubusercontent.com/3d9a9f6cdc8364237cd236a401b3d5787217883ba087dedb6098d4bdba026d34/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f736f6c7574696f6e666f726573742f66696c616d656e742d6f74702d696e7075743f7374796c653d666c61742d737175617265)](https://github.com/solutionforest/filament-otp-input/blob/main/LICENSE.md)

[![One-Time Passcode (OTP) input for Filament](https://raw.githubusercontent.com/hasan-ahani/filament-otp-input/master/docs/thumbnail.jpg)](https://raw.githubusercontent.com/hasan-ahani/filament-otp-input/master/docs/thumbnail.jpg)

`filament-otp-input` is a package built for [Filament](https://filamentphp.com) that provides a One-Time Passcode (OTP) input form component that offers you the ability to add the following features:

- Customize the number of inputs
- Perform an action after filling the code
- Move to the next input after filling
- Move to the previous input with backspaces

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

[](#installation)

> **Requires [PHP 8.2+](https://php.net/releases/), and [Laravel 11.0+](https://laravel.com)**.

You can install the package via composer:

```
composer require solution-forest/filament-otp-input
```

Usage
-----

[](#usage)

Inside a form schema, you can use the Otp input like this:

```
use HasanAhani\FilamentOtpInput\Components;
use Filament\Forms\Form;

public function form(Form $form): Form
{
    return $form
        ->schema([
            // ...
            OtpInput::make('otp')
                ->label('Otp'),
        ]);
}
```

The code above will render a otp input inside the form.

[![Otp input](https://raw.githubusercontent.com/hasan-ahani/filament-otp-input/master/docs/otp.png)](https://raw.githubusercontent.com/hasan-ahani/filament-otp-input/master/docs/otp.png)

Number inputs
-------------

[](#number-inputs)

If the number of entries you want is less or more than the default 4 numbers, you can change it according to the example below

```
use HasanAhani\FilamentOtpInput\Components;
use Filament\Forms\Form;

public function form(Form $form): Form
{
    return $form
        ->schema([
            // ...
            OtpInput::make('otp')
                ->numberInput(6)
                ->label('Otp'),
        ]);
}
```

The above code creates 6 inputs for entering the OTP code.

[![Otp input number](https://raw.githubusercontent.com/hasan-ahani/filament-otp-input/master/docs/otp-number.png)](https://raw.githubusercontent.com/hasan-ahani/filament-otp-input/master/docs/otp-number.png)

Get Code
--------

[](#get-code)

If you need to receive the code after entering it completely, proceed as in the example below

```
use HasanAhani\FilamentOtpInput\Components;
use Filament\Forms\Form;

public function form(Form $form): Form
{
    return $form
        ->schema([
            // ...
            OtpInput::make('otp')
                ->numberInput(8)
                ->afterStateUpdated(function (string $state){
                    dd($state);
                    // submit form or save record
                })
                ->label('Otp'),
        ]);
}
```

Input type
----------

[](#input-type)

By default, the input type is set to "number". If you need to change it to "password" or "text", you can use the following methods:

```
use HasanAhani\FilamentOtpInput\Components;
use Filament\Forms\Form;

public function form(Form $form): Form
{
    return $form
        ->schema([
            // ...
            OtpInput::make('otp')
                ->password()
                // or
                ->text()
                ->label('Otp'),
        ]);
}
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](https://github.com/hasan-ahani/filament-otp-input/blob/master/CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Hasan Ahani](https://github.com/hasan-ahani)
- [All Contributors](https://github.com/hasan-ahani/filament-otp-input/graphs/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/hasan-ahani/blob/master/LICENSE.md) for more information.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance54

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.3% 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 ~44 days

Recently: every ~97 days

Total

12

Last Release

339d ago

Major Versions

v1.0.9 → v2.0.02025-06-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/9499120912b47a170291b3b795ea0255f060d8500bd2988535e4e6faccee5c8d?d=identicon)[solutionforest](/maintainers/solutionforest)

---

Top Contributors

[![hasan-ahani](https://avatars.githubusercontent.com/u/67734902?v=4)](https://github.com/hasan-ahani "hasan-ahani (28 commits)")[![lam0819](https://avatars.githubusercontent.com/u/68211972?v=4)](https://github.com/lam0819 "lam0819 (14 commits)")[![sadegh19b](https://avatars.githubusercontent.com/u/54643531?v=4)](https://github.com/sadegh19b "sadegh19b (2 commits)")[![sfkelseylee](https://avatars.githubusercontent.com/u/138422247?v=4)](https://github.com/sfkelseylee "sfkelseylee (2 commits)")[![asanovr](https://avatars.githubusercontent.com/u/6459461?v=4)](https://github.com/asanovr "asanovr (1 commits)")[![jacklove315](https://avatars.githubusercontent.com/u/49924120?v=4)](https://github.com/jacklove315 "jacklove315 (1 commits)")

---

Tags

laravelfilamentfilament-formhasan-ahaniotp-input

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/solution-forest-filament-otp-input/health.svg)

```
[![Health](https://phpackages.com/badges/solution-forest-filament-otp-input/health.svg)](https://phpackages.com/packages/solution-forest-filament-otp-input)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

320392.1k17](/packages/codewithdennis-filament-select-tree)[hasan-ahani/filament-otp-input

Otp input for filament

2678.1k](/packages/hasan-ahani-filament-otp-input)[rawilk/filament-password-input

Enhanced password input component for filament.

52232.4k3](/packages/rawilk-filament-password-input)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[guava/filament-modal-relation-managers

Allows you to embed relation managers inside filament modals.

7565.0k4](/packages/guava-filament-modal-relation-managers)

PHPackages © 2026

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