PHPackages                             moonshine/two-factor - 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. moonshine/two-factor

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

moonshine/two-factor
====================

Two factor authentication for MoonShine

3.1.0(4mo ago)47.6k↓34.2%3[1 issues](https://github.com/moonshine-software/two-factor/issues)[1 PRs](https://github.com/moonshine-software/two-factor/pulls)MITPHPPHP ^8.2|^8.3

Since Dec 9Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/moonshine-software/two-factor)[ Packagist](https://packagist.org/packages/moonshine/two-factor)[ Docs](https://moonshine-laravel.com)[ RSS](/packages/moonshine-two-factor/feed)WikiDiscussions 3.x Synced 2d ago

READMEChangelog (10)Dependencies (12)Versions (14)Used By (0)

MoonShine two-factor authentication
-----------------------------------

[](#moonshine-two-factor-authentication)

### Requirements

[](#requirements)

- MoonShine v4.0+

### Support MoonShine versions

[](#support-moonshine-versions)

MoonShineLayouts2.0+1.0+3.0+2.0+4.0+3.0+### Installation

[](#installation)

```
composer require moonshine/two-factor
```

```
php artisan migrate
```

### Get started

[](#get-started)

Add pipe to config/moonshine.php

```
use MoonShine\TwoFactor\TwoFactorAuthPipe;

return [
    // ...
    'auth' => [
        // ...
        'pipelines' => [
            TwoFactorAuthPipe::class
        ],
        // ...
    ]
    // ...
];
```

or in `MoonShineServiceProvider`

```
use MoonShine\TwoFactor\TwoFactorAuthPipe;

$config->authPipelines([
    TwoFactorAuthPipe::class
]);
```

Add trait TwoFactorAuthenticatable to model or use MoonShine\\TwoFactor\\Models\\MoonshineUser

```
use MoonShine\TwoFactor\Traits\TwoFactorAuthenticatable;

class MoonshineUser extends Model
{
    use TwoFactorAuthenticatable;
}
```

We will automatically add the component to the profile page, but if you use another page, you can add it yourself.

```
use MoonShine\TwoFactor\ComponentSets\TwoFactor;

protected function components(): iterable
{
    return [
        // ...

        TwoFactor::make(),
    ];
}
```

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance73

Regular maintenance activity

Popularity31

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 69.6% 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 ~62 days

Recently: every ~103 days

Total

14

Last Release

120d ago

Major Versions

1.x-dev → 2.0.02024-10-15

2.x-dev → 3.0.02025-11-11

PHP version history (2 changes)1.0.0PHP ^8.1|^8.2|^8.3

2.0.0PHP ^8.2|^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1861327?v=4)[Danil Shutsky](/maintainers/lee-to)[@lee-to](https://github.com/lee-to)

---

Top Contributors

[![lee-to](https://avatars.githubusercontent.com/u/1861327?v=4)](https://github.com/lee-to "lee-to (16 commits)")[![TheForwardDev](https://avatars.githubusercontent.com/u/167892602?v=4)](https://github.com/TheForwardDev "TheForwardDev (6 commits)")[![warete](https://avatars.githubusercontent.com/u/12802923?v=4)](https://github.com/warete "warete (1 commits)")

---

Tags

moonshinetwo-factor2fatwo-factormoonshine

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/moonshine-two-factor/health.svg)

```
[![Health](https://phpackages.com/badges/moonshine-two-factor/health.svg)](https://phpackages.com/packages/moonshine-two-factor)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[statamic/cms

The Statamic CMS Core Package

4.8k3.6M984](/packages/statamic-cms)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

84215.9k9](/packages/stephenjude-filament-two-factor-authentication)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.9k69.5k](/packages/grumpydictator-firefly-iii)[jeffgreco13/filament-breezy

A custom package for Filament with login flow, profile and teams support.

1.0k2.1M59](/packages/jeffgreco13-filament-breezy)

PHPackages © 2026

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