← All plugins

MoonShine two-factor authentication

Made by the authors of MoonShine

MoonShine Two-Factor Authentication - это пакет для MoonShine, который добавляет двухфакторную аутентификацию в админ-панель, позволяя повысить безопасность путем внедрения дополнительного уровня проверки при входе в систему.

Rating
Downloads
3555
Version
3.0.0
Last updated
11.11.2025
MoonShine version
v2, v3, v4
Github stars
3
MoonShine Software
Author
MoonShine Software

MoonShine two-factor authentication

Requirements

  • MoonShine v4.0+

Support MoonShine versions

MoonShine Layouts
2.0+ 1.0+
3.0+ 2.0+
4.0+ 3.0+

Installation

composer require moonshine/two-factor
composer require moonshine/two-factor
php artisan migrate
php artisan migrate

Get started

Add pipe to config/moonshine.php

use MoonShine\TwoFactor\TwoFactorAuthPipe;
 
return [
// ...
'auth' => [
// ...
'pipelines' => [
TwoFactorAuthPipe::class
],
// ...
]
// ...
];
use MoonShine\TwoFactor\TwoFactorAuthPipe;
 
return [
// ...
'auth' => [
// ...
'pipelines' => [
TwoFactorAuthPipe::class
],
// ...
]
// ...
];

or in MoonShineServiceProvider

use MoonShine\TwoFactor\TwoFactorAuthPipe;
 
$config->authPipelines([
TwoFactorAuthPipe::class
]);
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;
}
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(),
];
}
use MoonShine\TwoFactor\ComponentSets\TwoFactor;
 
protected function components(): iterable
{
return [
// ...
 
TwoFactor::make(),
];
}