Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament 2Fa Laravel Package

tfsthiagobr98/filament-2fa

View on GitHub
Deep Wiki
Context7

Filament 2FA Plugin

A Two Factor Authentication plugin for Filament

Installation

  1. Install the package via composer (requires filament >= 2.10.40)
composer require tfsthiagobr98/filament-2fa
  1. Publish assets and run migrations
php artisan vendor:publish --tag="filament-2fa-migrations"
php artisan migrate

Optionally, you can publish config or views:

php artisan vendor:publish --tag="filament-2fa-config"
php artisan vendor:publish --tag="filament-2fa-views"
  1. Add \TFSThiagoBR98\FilamentTwoFactor\TwoFactorAuthenticatable trait to your user model.

  2. Update the config/filament.php to point to the Two Factor Login::class.

"auth" => [
    "guard" => env("FILAMENT_AUTH_GUARD", "web"),
    "pages" => [
        "login" =>
            \TFSThiagoBR98\FilamentTwoFactor\Http\Livewire\Auth\Login::class,
    ],
],

Integrate With Custom Profile Page

This package has a component for two-factor setup that can be easily added to a profile page, like the one for filament-jetstream-theme.

Create a view with the <livewire:filament-two-factor-form> component like the example below:

// resources/views/partials/2fa-section.blade.php
<hr />

<x-filament-jetstream::grid-section class="mt-8">
    <x-slot name="title">
        {{ __('filament-2fa::two-factor.title') }}
    </x-slot>

    <x-slot name="description">
        {{ __('filament-2fa::two-factor.description') }}
    </x-slot>

    <div class="space-y-3">
        <x-filament::card>
            <livewire:filament-two-factor-form>
        </x-filament::card>
    </div>
</x-filament-jetstream::grid-section>

Then add the view to your profile page using render hook:

## in Service Provider file
public function boot()
{
    Filament::registerRenderHook(
        'filament-jetstream.profile-page.end',
        fn (): View => view('partials.2fa-section'),
    );
}

Screenshots

Two Factor Page Confirm Password Finishing enable Recovery codes Enabled Challenge Breezy

Credits

License

The MIT License (MIT). Please see License File for more information.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope