PHPackages                             sh4msi/filament-otp - 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. sh4msi/filament-otp

ActiveLibrary

sh4msi/filament-otp
===================

Filament OTP is a package for Filament that allows users to login with a One-Time Password. (OTP and Passwordless are similar, but they differ in some aspects!)

v2.0.0(8mo ago)3328[5 PRs](https://github.com/sh4msi/filament-otp/pulls)MITPHPPHP ^8.2CI passing

Since Dec 3Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/sh4msi/filament-otp)[ Packagist](https://packagist.org/packages/sh4msi/filament-otp)[ Docs](https://github.com/sh4msi/filament-otp)[ GitHub Sponsors](https://github.com/sh4msi)[ RSS](/packages/sh4msi-filament-otp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (14)Versions (9)Used By (0)

Filament OTP
============

[](#filament-otp)

[![Latest Version on Packagist](https://camo.githubusercontent.com/62a61f2d7690f23d366eb27f3b4b674585157b32ac30fa801aa011b263579aba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7368346d73692f66696c616d656e742d6f74702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sh4msi/filament-otp)[![GitHub Tests Action Status](https://camo.githubusercontent.com/1602273ce11b6a2aef52c9e6fbd805352dc4e8d5d1586e9289f6a84acdf354e4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7368346d73692f66696c616d656e742d6f74702f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/sh4msi/filament-otp/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/f8a6a84b8d6e5ac2b01a7240ccae95ba421c1c875ad498b8529cb2093ffcec8a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7368346d73692f66696c616d656e742d6f74702f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/sh4msi/filament-otp/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/80cf240baad68f716fa279fe4c95ac15faaae466ec821ab32284363ebacdb740/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7368346d73692f66696c616d656e742d6f74702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sh4msi/filament-otp)

Filament OTP is a package for **Filament 3** that allows users to login with a One-Time Password. (OTP and Passwordless are similar, but they differ in some aspects!)

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

[](#installation)

You can install the package via composer:

```
composer require sh4msi/filament-otp
```

You can publish the config file with:

```
php artisan vendor:publish --tag="filament-otp-config"
```

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="filament-otp-views"
```

This is the contents of the published config file:

```
return [
    /**
     * The authentication model to use.
     */
    'user_model' => \App\Models\User::class,

    /**
     * login columns
     */
    'login_key' => 'email',

    'login_key_rule' => ['email', 'required'],

    /**
     * token resend countdown time
     */
    'resent_token_countdown_time' => 60,

    /**
     * token count
     */
    'token_count' => 5,

    /**
     * token type
     * number, string, etc
     */
    'token_type' => 'number',

    /**
     * token expiry (minutes)
     */
    'token_expiry' => 15,

    /**
     * Rate limit count
     */
    'rate_limit_count' => 3,

    /**
     * Rate limit decay seconds
     */
    'rate_limit_decay_seconds' => 30,

    /**
     * Token generator class must implement TokenGeneratorInterface
     */
    'token_generator' => \Sh4msi\FilamentOtp\Utility\TokenGenerator::class,

    /**
     * Token notification class
     */
    'token_notification' => \Sh4msi\FilamentOtp\Notifications\NotificationOTP::class,

    /**
     * Login confirmation page component
     *
     * If you want to change something, place your component here.
     */
    'confirm_token_component' => \Sh4msi\FilamentOtp\Http\Livewire\Auth\ConfirmOTP::class,

    'login_otp_component' => \Sh4msi\FilamentOtp\Http\Livewire\Auth\LoginOTP::class,

];
```

Usage
-----

[](#usage)

Add the Sh4msi\\FilamentOtp\\Traits\\OtpLogin trait to your User model(s):

```
use Illuminate\Foundation\Auth\User as Authenticatable;
use Sh4msi\FilamentOtp\Traits\OtpLogin;

class User extends Authenticatable
{
    use OtpLogin;

    // ...
}
```

You can use the renderHook() method in the panel configuration object to display the "login with one-time password" button on the login page.

```
use Filament\Panel;
use Illuminate\Contracts\View\View;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->renderHook(
            'panels::auth.login.form.after',
            fn (): View => View('filament-otp::livewire.login-otp-btn'),
        )
}
```

OR call by route

```
route('filament-otp.login')
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Saeed Shamsi](https://github.com/sh4msi)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance70

Regular maintenance activity

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 64% 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 ~325 days

Total

3

Last Release

241d ago

Major Versions

v1.0.1 → v2.0.02025-09-13

PHP version history (2 changes)v1.0.0PHP ^8.1

v2.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/32f1cefc550790905ad9003a3f19b3943cc6eaad084fcf055297c2a1d7734227?d=identicon)[sh4msi](/maintainers/sh4msi)

---

Top Contributors

[![sh4msi](https://avatars.githubusercontent.com/u/6229984?v=4)](https://github.com/sh4msi "sh4msi (16 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")[![google-labs-jules[bot]](https://avatars.githubusercontent.com/in/842251?v=4)](https://github.com/google-labs-jules[bot] "google-labs-jules[bot] (1 commits)")

---

Tags

laravelsh4msifilament-otp

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/sh4msi-filament-otp/health.svg)

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

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[guava/calendar

Adds support for vkurko/calendar to Filament PHP.

298241.0k3](/packages/guava-calendar)[guava/filament-knowledge-base

A filament plugin that adds a knowledge base and help to your filament panel(s).

206120.5k1](/packages/guava-filament-knowledge-base)[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)[bezhansalleh/filament-plugin-essentials

A collection of essential traits that streamline Filament plugin development by taking care of the boilerplate, so you can focus on shipping real features faster

27584.7k16](/packages/bezhansalleh-filament-plugin-essentials)[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)
