PHP code example of tfsthiagobr98 / filament-2fa

1. Go to this page and download the library: Download tfsthiagobr98/filament-2fa library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tfsthiagobr98 / filament-2fa example snippets


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

// 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>

## in Service Provider file
public function boot()
{
    Filament::registerRenderHook(
        'filament-jetstream.profile-page.end',
        fn (): View => view('partials.2fa-section'),
    );
}
bash
php artisan vendor:publish --tag="filament-2fa-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="filament-2fa-config"
php artisan vendor:publish --tag="filament-2fa-views"