PHPackages                             mortezamasumi/fb-auth - 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. mortezamasumi/fb-auth

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

mortezamasumi/fb-auth
=====================

Filament authentication with mobile, code, username, and magic-link flows

v5.1.0(2w ago)02322MITPHPPHP ^8.3CI passing

Since Aug 1Pushed 2w agoCompare

[ Source](https://github.com/mortezamasumi/fb-auth)[ Packagist](https://packagist.org/packages/mortezamasumi/fb-auth)[ Docs](https://github.com/mortezamasumi/fb-auth)[ RSS](/packages/mortezamasumi-fb-auth/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (49)Versions (41)Used By (2)

FB Auth — Filament Authentication
=================================

[](#fb-auth--filament-authentication)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f670f388402679254dc178ac772960241ae91c1b6a5409b9ed6489e595381065/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f7274657a616d6173756d692f66622d617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mortezamasumi/fb-auth)[![GitHub Tests Action Status](https://camo.githubusercontent.com/b531049ea37925c762656953970748ec9d0c7bddc038401061f03b708e8508ad/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d6f7274657a616d6173756d692f66622d617574682f63692e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/mortezamasumi/fb-auth/actions?query=branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/5151fcdca01dca6fb901809f5e4904e0d0d33b7eece5e88df2cdc03d8dc2f8ab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6f7274657a616d6173756d692f66622d617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mortezamasumi/fb-auth)[![License](https://camo.githubusercontent.com/d806deb3a17b9e70f4306d6eb197a5e7dff16d97b65e1d3e180f55081fcd90a0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6f7274657a616d6173756d692f66622d617574682e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

A Filament v5 plugin that provides configurable authentication flows for your Laravel admin panel: **magic link**, **email code**, **mobile SMS code**, and **username/password**. It ships custom login, registration, email verification, and password-reset pages — with rate-limited, OTP-based resend actions and bilingual notifications.

---

Features
--------

[](#features)

- **Four auth flows** — switch with a single config key: `link` (magic link), `code` (email code), `mobile` (SMS code via [fb-sms](https://github.com/mortezamasumi/fb-sms)), and `user` (username/password)
- **OTP login &amp; registration** — dedicated pages with a resendable, expiring code for `code` and `mobile` flows
- **Code-based password reset** — request, resend, and reset flows built on the same OTP mechanism
- **Email verification prompt** — code input page for verifying newly registered users
- **SMS delivery** — mobile codes are sent through the configured fb-sms gateway
- **Rate limiting** — every send/verify action is throttled to prevent abuse
- **Localized UI** — Persian and English translations shipped out of the box

---

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

[](#installation)

```
composer require mortezamasumi/fb-auth
```

Publish the config file:

```
php artisan vendor:publish --tag="fb-auth-config"
```

Optionally publish the views:

```
php artisan vendor:publish --tag="fb-auth-views"
```

---

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

[](#configuration)

```
// config/fb-auth.php
return [
    'auth_type' => env('AUTH_TYPE', 'link'),
    'otp_digits' => env('OTP_DIGITS', 4),
    'otp_expiration' => env('OTP_EXPIRATION', 120),
];
```

- `auth_type` — `link` (default), `code`, `mobile`, or `user`
- `otp_digits` — length of the generated verification code (default `4`)
- `otp_expiration` — code lifetime in seconds (default `120`)

---

Usage
-----

[](#usage)

### Register the plugin in a panel

[](#register-the-plugin-in-a-panel)

```
use Mortezamasumi\FbAuth\FbAuthPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugin(FbAuthPlugin::make());
}
```

### Choose an auth flow

[](#choose-an-auth-flow)

Set `AUTH_TYPE` in your `.env`:

ValueFlowLogin / registerReset password`link`Magic linkFilament's built-in pagesFilament's built-in pages`code`Email codeOTP page (code sent by email)OTP-based reset pages`mobile`Mobile SMS codeOTP page (code sent by SMS)OTP-based reset pages`user`Username / passwordFilament's built-in pagesdisabled### Generate and send codes

[](#generate-and-send-codes)

```
use Mortezamasumi\FbAuth\Facades\FbAuth;

$code = FbAuth::createCode($user);        // generates + caches a code for the user
$digits = FbAuth::generateRandomCode();   // random code using otp_digits/otp_expiration

echo FbAuth::encodeEmail('test@example.com'); // masked email, e.g. **st@**mp.**m
```

---

Support policy
--------------

[](#support-policy)

PHPLaravelFilament8.3125.x---

Testing
-------

[](#testing)

```
composer test
```

---

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

[](#contributing)

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

Security
--------

[](#security)

If you discover a security vulnerability, please review our [security policy](.github/SECURITY.md) on how to report it.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for recent changes.

---

License
-------

[](#license)

The MIT License (MIT). See [LICENSE.md](LICENSE.md) for details.

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance96

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

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 ~9 days

Total

40

Last Release

18d ago

Major Versions

v1.0.0 → v2.0.02025-08-01

v2.0.0 → v3.0.02025-08-01

v3.0.0 → v4.0.02025-08-01

v4.4.3 → v5.0.02026-07-09

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

v4.2.12PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/41052038?v=4)[M.M](/maintainers/mortezamasumi)[@mortezamasumi](https://github.com/mortezamasumi)

---

Top Contributors

[![mortezamasumi](https://avatars.githubusercontent.com/u/41052038?v=4)](https://github.com/mortezamasumi "mortezamasumi (46 commits)")

---

Tags

laravelfilamentmortezamasumifb-auth

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mortezamasumi-fb-auth/health.svg)

```
[![Health](https://phpackages.com/badges/mortezamasumi-fb-auth/health.svg)](https://phpackages.com/packages/mortezamasumi-fb-auth)
```

###  Alternatives

[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3915.5k](/packages/rawilk-profile-filament-plugin)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

85240.3k9](/packages/stephenjude-filament-two-factor-authentication)[marcelweidum/filament-passkeys

Use passkeys in your filamentphp app

6758.2k2](/packages/marcelweidum-filament-passkeys)[backstage/mails

View logged mails and events in a beautiful Filament UI.

16429.7k](/packages/backstage-mails)[finity-labs/fin-mail

A powerful email template manager and composer for Filament with dynamic token replacement, template versioning, and inline email sending.

316.8k2](/packages/finity-labs-fin-mail)[waguilar33/filament-guardian

Role and permission management for Filament

175.2k](/packages/waguilar33-filament-guardian)

PHPackages © 2026

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