PHP code example of adriaanzon / filament-passkeys

1. Go to this page and download the library: Download adriaanzon/filament-passkeys 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/ */

    

adriaanzon / filament-passkeys example snippets


   use Filament\Models\Contracts\FilamentUser;
   use Illuminate\Foundation\Auth\User as Authenticatable;
   use Laravel\Passkeys\Contracts\PasskeyUser;
   use Laravel\Passkeys\PasskeyAuthenticatable;

   class User extends Authenticatable implements FilamentUser, PasskeyUser
   {
       use PasskeyAuthenticatable;

       // ...
   }
   

   use AdriaanZon\FilamentPasskeys\FilamentPasskeysPlugin;
   use AdriaanZon\FilamentPasskeys\PasskeyAuthentication;

   public function panel(Panel $panel): Panel
   {
       return $panel
           ->login()
           ->profile()
           // ...
           ->plugins([
               FilamentPasskeysPlugin::make()->passwordlessLogin(),
           ])
           ->multiFactorAuthentication([
               PasskeyAuthentication::make()->managementOnly(),
           ]);
   }
   

->plugins([
    FilamentPasskeysPlugin::make()->passwordlessLogin(),
])
->multiFactorAuthentication([
    PasskeyAuthentication::make()->managementOnly(),
]);

->plugins([
    FilamentPasskeysPlugin::make(),
])
->multiFactorAuthentication([
    PasskeyAuthentication::make(),
])

use Filament\Auth\MultiFactor\Email\EmailAuthentication;

->multiFactorAuthentication([
    PasskeyAuthentication::make(),
    EmailAuthentication::make(),
])

->plugins([
    FilamentPasskeysPlugin::make()->passwordlessLogin(),
])
->multiFactorAuthentication([
    PasskeyAuthentication::make(),
])
bash
   php artisan vendor:publish --tag="passkeys-migrations"
   php artisan migrate
   
bash
php artisan vendor:publish --tag="passkeys-config"