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(2mo ago)35.7k↓25%4[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 2mo 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 1mo 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

50

—

FairBetter than 96% of packages

Maintenance79

Regular maintenance activity

Popularity29

Limited adoption so far

Community13

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

75d 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

[laragear/two-factor

On-premises 2FA Authentication for out-of-the-box.

339785.3k8](/packages/laragear-two-factor)[markshust/magento2-module-disabletwofactorauth

The DisableTwoFactorAuth module provides the ability to disable two-factor authentication.

2282.7M6](/packages/markshust-magento2-module-disabletwofactorauth)[scheb/2fa-bundle

A generic interface to implement two-factor authentication in Symfony applications

7014.0M62](/packages/scheb-2fa-bundle)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

81158.7k4](/packages/stephenjude-filament-two-factor-authentication)[paragonie/multi-factor

Vendor-agnostic two-factor authentication library

142195.5k2](/packages/paragonie-multi-factor)[scheb/2fa-google-authenticator

Extends scheb/2fa-bundle with two-factor authentication using Google Authenticator

298.2M30](/packages/scheb-2fa-google-authenticator)

PHPackages © 2026

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