### Setup modal component lifecycle (Blade and HTML) Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/livewire-register-passkey.md The setup modal renders a Livewire component with a redirect URL. The user inputs a passkey name and triggers the registration flow, which includes browser ceremony and storage, potentially surfacing a ValidationException. ```blade {{-- resources/views/vendor/filament-multifactor-passkeys/components/create.blade.php --}} ``` ```html ``` -------------------------------- ### Install package via Composer Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/README.md Install the package using Composer. ```bash composer require jeffersongoncalves/filament-multifactor-passkeys ``` -------------------------------- ### Example — basic fallback Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/passkey-authentication.md Shows how to get the redirect URL without setting a custom callback. The provider resolves to the current panel's URL or '/'. ```php use JeffersonGoncalves\Filament\MultiFactorPasskeys\PasskeyAuthentication; // No callback set: resolves to the current panel's URL (or '/'). $provider = PasskeyAuthentication::make(); $url = $provider->getRedirectUrl(); // string, e.g. 'http://localhost/admin' ``` -------------------------------- ### Example: running the disable routine outside the action Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/actions.md Shows how to manually delete all passkeys for the authenticated user in a transaction. Requires the user to implement HasPasskeyAuthentication, otherwise the passkeys() relation call fails at runtime. ```php use Illuminate\Support\Facades\DB; use Filament\Notifications\Notification; use JeffersonGoncalves\Filament\MultiFactorPasskeys\Contracts\HasPasskeyAuthentication; use Filament\Facades\Filament; /** @var HasPasskeyAuthentication $user */ $user = Filament::auth()->user(); DB::transaction(function () use ($user): void { $user->passkeys()->delete(); }); // relies on the authenticated user implementing HasPasskeyAuthentication, // otherwise the passkeys() relation call fails at runtime ``` -------------------------------- ### Example — with the contract enforced Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/passkey-authentication.md Shows how to call `isEnabled()` while ensuring the user implements `HasPasskeyAuthentication` to avoid the `LogicException`. The example retrieves the authenticated user, checks the contract, and then calls `isEnabled()`. ```php use JeffersonGoncalves\Filament\MultiFactorPasskeys\PasskeyAuthentication; use JeffersonGoncalves\Filament\MultiFactorPasskeys\Contracts\HasPasskeyAuthentication; $user = auth()->user(); // must implement HasPasskeyAuthentication if (! $user instanceof HasPasskeyAuthentication) { // Prevent the LogicException from isEnabled(). throw new RuntimeException('User model is missing HasPasskeyAuthentication.'); } $enabled = PasskeyAuthentication::make()->isEnabled($user); // bool ``` -------------------------------- ### Direct component call example for AuthenticatePasskey Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/livewire-authenticate-passkey.md Shows how to invoke the Livewire component directly, e.g., from a test or custom trigger. Requires a prior getOptions() call to generate a challenge; otherwise authenticate() flashes an error and does not log in. ```php use Livewire\Livewire; use JeffersonGoncalves\Filament\MultiFactorPasskeys\Livewire\AuthenticatePasskey; Livewire::test(AuthenticatePasskey::class, ['guard' => 'web', 'redirectUrl' => '/admin']) ->call('getOptions') ->assertDispatched('passkey-authentication-options-ready'); // A subsequent authenticate() with a valid assertion JSON string logs the // user in and redirects to /admin; with no prior getOptions() it flashes // 'authenticatePasskey::message' and does not authenticate. ``` -------------------------------- ### PanelProvider example with MultiFactorPasskeysPlugin Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/multifactor-passkeys-plugin.md Shows non-test usage in a PanelProvider. Configures the panel with an admin ID, path, auth guard, login, multi-factor authentication with PasskeyAuthentication, and the plugin. After registration, the login screen renders the standard form, a divider, and a passkey button. ```php // PanelProvider (non-test usage) use Filament\Panel; use JeffersonGoncalves\Filament\MultiFactorPasskeys\MultiFactorPasskeysPlugin; use JeffersonGoncalves\Filament\MultiFactorPasskeys\PasskeyAuthentication; public function panel(Panel $panel): Panel { return $panel ->id('admin') ->path('admin') ->authGuard('web') ->login() ->multiFactorAuthentication([ PasskeyAuthentication::make(), ]) ->plugin(MultiFactorPasskeysPlugin::make()); } ``` -------------------------------- ### Register ceremony flow Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/frontend-assets-and-views.md Listens for the 'passkey-registration-options-ready' event, starts registration with the options, and calls the Livewire 'storePasskey' method with the passkey. ```javascript Livewire.on('passkey-registration-options-ready', async function (eventData) { // ...normalise payload/options... const passkey = await window.FilamentMultiFactorPasskeys.startRegistration({ optionsJSON: options }); @this.call('storePasskey', JSON.stringify(passkey)); }); ``` -------------------------------- ### Example — custom redirect Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/passkey-authentication.md Sets a custom redirect URL using the Laravel route() helper. The provider is then passed to the panel's multiFactorAuthentication method. ```php use JeffersonGoncalves\Filament\MultiFactorPasskeys\PasskeyAuthentication; $provider = PasskeyAuthentication::make() ->redirectUrlUsing(fn () => route('dashboard')); // Laravel route() helper return $panel ->multiFactorAuthentication([$provider]); ``` -------------------------------- ### Authenticate ceremony flow Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/frontend-assets-and-views.md Listens for the 'passkey-authentication-options-ready' event, starts authentication with the options, and calls the Livewire 'authenticate' method with the assertion. ```javascript Livewire.on('passkey-authentication-options-ready', async function (eventData) { // ...normalise payload/options... const assertion = await window.FilamentMultiFactorPasskeys.startAuthentication({ optionsJSON: options }); @this.call('authenticate', JSON.stringify(assertion)); }); ``` -------------------------------- ### Enforcing the contract before calling the provider Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/has-passkey-authentication.md Example showing how to short-circuit the LogicException by checking instanceof before calling PasskeyAuthentication::isEnabled(). Returns false if the user does not implement the contract. ```php use Illuminate\Contracts\Auth\Authenticatable; use JeffersonGoncalves\Filament\MultiFactorPasskeys\Contracts\HasPasskeyAuthentication; use JeffersonGoncalves\Filament\MultiFactorPasskeys\PasskeyAuthentication; function userHasPasskeyMfa(Authenticatable $user): bool { if (! $user instanceof HasPasskeyAuthentication) { return false; // short-circuit instead of letting isEnabled() throw } return PasskeyAuthentication::make()->isEnabled($user); } ``` -------------------------------- ### SetUpPasskeyAuthenticationAction::make() Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/actions.md Builds the 'Set up' action that opens a large modal embedding the passkey registration ceremony. This static factory returns a configured Filament\Actions\Action instance. ```APIDOC ## SetUpPasskeyAuthenticationAction::make() ### Description Builds the "Set up" action that opens a large modal embedding the passkey registration ceremony. This static factory returns a configured Filament\Actions\Action instance. ### Method make() ### Signature public static function make(PasskeyAuthentication $passkeyAuthentication): Action ### Parameters - **$passkeyAuthentication** (JeffersonGoncalves\Filament\MultiFactorPasskeys\PasskeyAuthentication) - Required - Provider instance; used only to resolve the redirect URL ($passkeyAuthentication->getRedirectUrl()) passed to the modal. ### Return Filament\Actions\Action ### Configuration Applied (in chain order) - Action::make(...) - action name 'setUpPasskeyAuthentication' - label() - filament-multifactor-passkeys::actions/set-up.label (English: Set up) - color() - 'primary' - icon() - Filament\Support\Icons\Heroicon::FingerPrint - link() - render style - modalWidth() - Filament\Support\Enums\Width::Large - modalIcon() - Heroicon::OutlinedFingerPrint - modalIconColor() - 'primary' - modalHeading() - actions/set-up.modal.heading - modalDescription() - actions/set-up.modal.description - schema([...]) - one Filament\Schemas\Components\View rendering filament-multifactor-passkeys::components.create with viewData(['redirect' => $passkeyAuthentication->getRedirectUrl()]) - modalSubmitAction(false) - no footer submit button (the embedded Livewire registration form has its own submit) - modalCancelAction(false) - no footer cancel button - modalCancelActionLabel() - actions/set-up.modal.actions.cancel.label (English: Close) ### Example — direct use outside the provider ```php use JeffersonGoncalves\Filament\MultiFactorPasskeys\Actions\SetUpPasskeyAuthenticationAction; use JeffersonGoncalves\Filament\MultiFactorPasskeys\PasskeyAuthentication; $provider = PasskeyAuthentication::make(); $action = SetUpPasskeyAuthenticationAction::make($provider); $action->schema($action->getSchema()); // modal hosts the RegisterPasskey Livewire form ``` ``` -------------------------------- ### Publish and run migrations from spatie/laravel-passkeys Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/README.md Publish the migrations from the spatie/laravel-passkeys package and run them. ```bash php artisan vendor:publish --tag="passkeys-migrations" php artisan migrate ``` -------------------------------- ### Prepare User model with InteractsWithPasskeys and HasPasskeyAuthentication Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/README.md Add the Spatie trait and implement the package's contract to enable passkey authentication on the User model. ```php use Filament\Models\Contracts\FilamentUser; use Illuminate\Foundation\Auth\User as Authenticatable; use JeffersonGoncalves\Filament\MultiFactorPasskeys\Contracts\HasPasskeyAuthentication; use Spatie\LaravelPasskeys\Models\Concerns\InteractsWithPasskeys; class User extends Authenticatable implements FilamentUser, HasPasskeyAuthentication { use InteractsWithPasskeys; public function hasPasskeyAuthentication(): bool { return $this->passkeys()->exists(); } // ... } ``` -------------------------------- ### SetUpPasskeyAuthenticationAction::make() signature Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/actions.md Static factory method that builds the 'Set up' action. Requires a PasskeyAuthentication provider instance, used only to resolve the redirect URL passed to the modal. ```php public static function make(PasskeyAuthentication $passkeyAuthentication): Action ``` -------------------------------- ### Development Commands Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/README.md Run static analysis, code style checks, and tests for the package. ```bash composer analyse ``` ```bash composer format ``` ```bash composer test ``` -------------------------------- ### mount() method signature Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/livewire-authenticate-passkey.md Initializes the component with a guard name and optional redirect URL. The guard defaults to 'web' and the redirect URL defaults to the root URL when null. ```php public function mount(string $guard = 'web', ?string $redirectUrl = null): void ``` -------------------------------- ### packageBooted() method signature Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/multifactor-passkeys-service-provider.md Declares the packageBooted() method that runs after the package boots. It registers Livewire components and Filament assets. ```php public function packageBooted(): void ``` -------------------------------- ### Publishing config and Spatie migrations Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/multifactor-passkeys-service-provider.md Commands to publish the Spatie passkeys migrations (recommended) and this package's optional config. Run migrate after publishing migrations. ```bash # Spatie package migrations (passkeys table) — recommended per README php artisan vendor:publish --tag="passkeys-migrations" php artisan migrate # This package's config (optional) php artisan vendor:publish --tag="filament-multifactor-passkeys-config" ``` -------------------------------- ### Instantiate actions in PasskeyAuthentication::getActions() Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/actions.md Returns both actions, each hidden or visible based on whether passkey authentication is enabled for the user. Used by PasskeyAuthentication::getActions() at src/PasskeyAuthentication.php:78-88. ```php return [ SetUpPasskeyAuthenticationAction::make($this) ->hidden(fn (): bool => $this->isEnabled($user)), DisablePasskeyAuthenticationAction::make($this) ->visible(fn (): bool => $this->isEnabled($user)), ]; ``` -------------------------------- ### configurePackage() method signature Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/multifactor-passkeys-service-provider.md Declares the configurePackage method that receives a Package instance from Spatie Laravel Package Tools during boot. ```php public function configurePackage(Package $package): void ``` -------------------------------- ### Publish package config Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/README.md Optionally publish this package's config. ```bash php artisan vendor:publish --tag="filament-multifactor-passkeys-config" ``` -------------------------------- ### Publish spatie/laravel-passkeys config Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/README.md Optionally publish the config to tweak relying party, allowed origins, etc. ```bash php artisan vendor:publish --tag="passkeys-config" ``` -------------------------------- ### Register MFA provider and plugin in PanelProvider Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/README.md Register PasskeyAuthentication in the multiFactorAuthentication array and the plugin to add a passkey login button. ```php use Filament\Panel; use JeffersonGoncalves\Filament\MultiFactorPasskeys\MultiFactorPasskeysPlugin; use JeffersonGoncalves\Filament\MultiFactorPasskeys\PasskeyAuthentication; public function panel(Panel $panel): Panel { return $panel // ... ->multiFactorAuthentication([ PasskeyAuthentication::make(), ]) ->plugin(MultiFactorPasskeysPlugin::make()); } ``` -------------------------------- ### make() Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/passkey-authentication.md Static factory method to create a new instance of the PasskeyAuthentication provider. Use this when registering the provider with Filament's multi-factor authentication system. ```APIDOC ## make() ### Description Static factory method to create a new instance of the PasskeyAuthentication provider. Use this when registering the provider with Filament's multi-factor authentication system. ### Method `public static function make(): static` ### Return Value - **static** - A new instance of the provider. ``` -------------------------------- ### make() method signature Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/multifactor-passkeys-plugin.md Factory method that resolves the plugin from the Laravel container using app(static::class). ```php public static function make(): static ``` -------------------------------- ### esbuild.config.js entry points and build options Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/frontend-assets-and-views.md Build configuration for bundling the package's JS and CSS entry points into resources/dist. Sets bundle, minify, target es2020, IIFE format, and browser platform. ```javascript // esbuild.config.js entryPoints: ['resources/js/passkey.js', 'resources/css/passkey.css'], bundle: true, minify: true, target: 'es2020', format: 'iife', platform: 'browser', ``` -------------------------------- ### Package config file (config/filament-multifactor-passkeys.php) Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/configuration.md Default configuration file with a single 'redirect' key. The key is currently not read by the package; use redirectUrlUsing() for custom redirects. ```php getUrl(). | */ 'redirect' => null, ]; ``` -------------------------------- ### Livewire mount call inside register() Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/multifactor-passkeys-plugin.md Mounts the AuthenticatePasskey Livewire component with guard and redirectUrl parameters. The guard is the panel's auth guard, and redirectUrl falls back to the application root when the panel has no URL. ```php Livewire::mount('filament-multifactor-passkeys-authenticate', [ 'guard' => $panel->getAuthGuard(), 'redirectUrl' => $panel->getUrl() ?? url('/'), ]) ``` -------------------------------- ### Set static redirect URL in config Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/README.md Set a static redirect URL via the package config file. ```php return [ 'redirect' => '/dashboard', ]; ``` -------------------------------- ### make() Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/passkey-authentication.md Factory method. Resolves a new instance from the application container (`app(static::class)`), so the instance is a Laravel container binding. Implemented to satisfy the `MultiFactorAuthenticationProvider` contract's static factory convention. ```APIDOC ## `make()` ### Description Factory method. Resolves a new instance from the application container (`app(static::class)`), so the instance is a Laravel container binding. Implemented to satisfy the `MultiFactorAuthenticationProvider` contract's static factory convention. ### Signature `make(): static` ### Source `src/PasskeyAuthentication.php:26-29` ``` -------------------------------- ### Direct use of SetUpPasskeyAuthenticationAction outside the provider Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/actions.md Creates the action manually and attaches the schema that hosts the RegisterPasskey Livewire form. The schema is retrieved via getSchema() and assigned to the action. ```php use JeffersonGoncalves\Filament\MultiFactorPasskeys\Actions\SetUpPasskeyAuthenticationAction; use JeffersonGoncalves\Filament\MultiFactorPasskeys\PasskeyAuthentication; $provider = PasskeyAuthentication::make(); $action = SetUpPasskeyAuthenticationAction::make($provider); $action->schema($action->getSchema()); // modal hosts the RegisterPasskey Livewire form ``` -------------------------------- ### register(Panel $panel): void Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/multifactor-passkeys-plugin.md Registers the plugin's render hook on the login form to mount the passkey authentication Livewire component. This method is called during panel registration and sets up the passkey login flow. ```APIDOC ## register(Panel $panel): void ### Description Registers a render hook on the login form to mount the passkey authentication Livewire component. This method is called during panel registration and sets up the passkey login flow. ### Method register ### Signature `public function register(Panel $panel): void` ### Parameters - **$panel** (Filament\Panel) - Required - The panel instance being registered. ### Mount Parameters | Parameter | Value Source | Description | |-----------|--------------|-------------| | `guard` | `$panel->getAuthGuard()` | The panel's auth guard, forwarded to `Auth::guard($guard)->login(...)` on successful assertion. | | `redirectUrl` | `$panel->getUrl() ?? url('/')` | Post-login redirect; falls back to the application root path when the panel has no URL. | ### Example ```php // PanelProvider (non-test usage) use Filament\Panel; use JeffersonGoncalves\Filament\MultiFactorPasskeys\MultiFactorPasskeysPlugin; use JeffersonGoncalves\Filament\MultiFactorPasskeys\PasskeyAuthentication; public function panel(Panel $panel): Panel { return $panel ->id('admin') ->path('admin') ->authGuard('web') ->login() ->multiFactorAuthentication([ PasskeyAuthentication::make(), ]) ->plugin(MultiFactorPasskeysPlugin::make()); } ``` The login screen then renders: 1. the standard email/password form, 2. a divider ("or"), 3. a "Sign in with a passkey" button that drives the `AuthenticatePasskey` Livewire component's `getOptions()` / `authenticate()` flow. The `guard` used for login is the panel's configured auth guard; the `redirectUrl` lands on the panel home (or `/`). ``` -------------------------------- ### PasskeyAuthentication::redirectUrlUsing() Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/configuration.md Sets a callback that returns the post-ceremony redirect URL for passkey authentication. Pass null to clear the callback and restore the panel/root fallback. ```APIDOC ## PasskeyAuthentication::redirectUrlUsing() ### Description Sets a callback that returns the post-ceremony redirect URL for passkey authentication. Pass null to clear the callback and restore the panel/root fallback. ### Method `redirectUrlUsing` ### Parameters - `$callback` (?Closure) - Required - Zero-argument callable returning the post-ceremony redirect URL; pass `null` to clear and restore the panel/root fallback. ### Request Example ```php use JeffersonGoncalves\Filament\MultiFactorPasskeys\PasskeyAuthentication; PasskeyAuthentication::make() ->redirectUrlUsing(fn () => route('dashboard')); ``` ``` -------------------------------- ### make() Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/multifactor-passkeys-plugin.md Static factory method that resolves the plugin from the Laravel container, following Filament's plugin factory convention. Returns a new instance of the plugin. ```APIDOC ## make() ### Description Static factory method that resolves the plugin from the Laravel container, following Filament's plugin factory convention. Returns a new instance of the plugin. ### Method `public static function make(): static` ### Return Value - **static** - A new instance of the plugin. ### Source `src/MultiFactorPasskeysPlugin.php:37-40` ``` -------------------------------- ### register() method signature Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/multifactor-passkeys-plugin.md Declares the register method that runs during panel registration. It registers a render hook on Filament\View\PanelsRenderHook::AUTH_LOGIN_FORM_AFTER to mount the Livewire component. ```php public function register(Panel $panel): void ``` -------------------------------- ### PasskeyAuthentication::redirectUrlUsing() - Set custom redirect URL Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/configuration.md Use this to override the post-ceremony redirect URL for passkey authentication. Pass a zero-argument closure returning the desired URL, or null to clear and restore the panel/root fallback. ```php use JeffersonGoncalves\Filament\MultiFactorPasskeys\PasskeyAuthentication; PasskeyAuthentication::make() ->redirectUrlUsing(fn () => route('dashboard')); ``` -------------------------------- ### DisablePasskeyAuthenticationAction::make() Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/actions.md Builds the 'Disable' action that is visible when passkey MFA is enabled. This static factory returns a configured Filament\Actions\Action instance. ```APIDOC ## DisablePasskeyAuthenticationAction::make() ### Description Builds the "Disable" action that is visible when passkey MFA is enabled. This static factory returns a configured Filament\Actions\Action instance. ### Method make() ### Signature public static function make(PasskeyAuthentication $passkeyAuthentication): Action ### Parameters - **$passkeyAuthentication** (JeffersonGoncalves\Filament\MultiFactorPasskeys\PasskeyAuthentication) - Required - Provider instance; used to configure the action. ### Return Filament\Actions\Action ### Configuration Applied (in chain order) - Action::make(...) - action name 'disablePasskeyAuthentication' - visible() - fn (): bool => $this->isEnabled($user) ### Example — direct use outside the provider ```php use JeffersonGoncalves\Filament\MultiFactorPasskeys\Actions\DisablePasskeyAuthenticationAction; use JeffersonGoncalves\Filament\MultiFactorPasskeys\PasskeyAuthentication; $provider = PasskeyAuthentication::make(); $action = DisablePasskeyAuthenticationAction::make($provider); ``` ``` -------------------------------- ### authenticate() Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/livewire-authenticate-passkey.md Verifies the browser assertion and completes login. Called from JavaScript with the serialized PublicKeyCredential JSON. ```APIDOC ## authenticate() ### Description Verifies the browser assertion and completes login. Called from JavaScript with the serialized `PublicKeyCredential` JSON. ### Method `authenticate` (Livewire component method) ### Parameters - `$assertion` (string) - Required - JSON string produced by `startAuthentication` (SimpleWebAuthn), e.g. `JSON.stringify(assertion)`. ### Flow 1. **Guard:** if `$options` is blank (no challenge generated for this request), flashes `authenticatePasskey::message` = `filament-multifactor-passkeys::login_button.errors.invalid` ("Invalid or unknown passkey.") and returns without logging in. 2. Resolves Spatie action `find_passkey` (default `Spatie\LaravelPasskeys\Actions\FindPasskeyToAuthenticateAction`) and runs `execute($assertion, $this->options)`; the challenge is then cleared (`$this->options = null`). 3. If no passkey matched, or its `authenticatable` is not an `Illuminate\Contracts\Auth\Authenticatable`, flashes the same invalid message and returns. 4. Otherwise: - `Auth::guard($this->guard)->login($authenticatable)` — logs the user into the panel's guard. - `Session::regenerate()` — session fixation protection. - `$passkey->update(['last_used_at' => now()])` — bumps the credential's last-use timestamp. - Sends a success `Notification` (title from `login_button.notifications.success.title`, body from `...success.body`). - `$this->redirect($this->redirectUrl ?: url('/'), navigate: false)` — full-page redirect. ### Return `void` ### Session Side Effects - Flash key `authenticatePasskey::message` (failure) - `Session::regenerate()` (success) ### Example — direct component call (e.g. from a test or a custom trigger) ```php use Livewire\Livewire; use JeffersonGoncalves\Filament\MultiFactorPasskeys\Livewire\AuthenticatePasskey; Livewire::test(AuthenticatePasskey::class, ['guard' => 'web', 'redirectUrl' => '/admin']) ->call('getOptions') ->assertDispatched('passkey-authentication-options-ready'); // A subsequent authenticate() with a valid assertion JSON string logs the // user in and redirects to /admin; with no prior getOptions() it flashes // 'authenticatePasskey::message' and does not authenticate. ``` ### Viewed from the login button (real usage) ```html ``` ``` -------------------------------- ### currentUser() method signature Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/livewire-register-passkey.md Protected method that resolves the passkey owner, preferring the Filament-authenticated user, otherwise the default guard's user. Returns a HasPasskeys instance or null, which can cause a failure in the Spatie store action when both are null. ```php protected function currentUser(): HasPasskeys ``` -------------------------------- ### resources/js/passkey.js - window.FilamentMultiFactorPasskeys bridge Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/frontend-assets-and-views.md Verbatim source of the JavaScript global that exposes startRegistration and startAuthentication from @simplewebauthn/browser. Both functions are async and called with { optionsJSON: options }. ```javascript import { startAuthentication, startRegistration, } from '@simplewebauthn/browser' window.FilamentMultiFactorPasskeys = { startRegistration, startAuthentication, } ``` -------------------------------- ### getManagementSchemaComponents() Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/passkey-authentication.md Returns an array of Filament schema components for the 'Passkey verification' section in the user profile management. This includes the 'Set up' and 'Turn off' actions. ```APIDOC ## getManagementSchemaComponents() ### Description Returns an array of Filament schema components for the 'Passkey verification' section in the user profile management. This includes the 'Set up' and 'Turn off' actions. ### Method `public function getManagementSchemaComponents(): array` ### Return Value - **array** - An array of Filament schema components. ``` -------------------------------- ### MultiFactorPasskeysPlugin class anatomy Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/multifactor-passkeys-plugin.md Shows the public methods of the plugin class: getId(), register(), boot(), and make(). ```php class MultiFactorPasskeysPlugin implements Plugin { public function getId(): string public function register(Panel $panel): void public function boot(Panel $panel): void public static function make(): static } ``` -------------------------------- ### authenticate() method signature Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/livewire-authenticate-passkey.md Declares the public method that verifies a browser assertion and completes login. Called from JavaScript with the serialized PublicKeyCredential JSON. ```php public function authenticate(string $assertion): void ``` -------------------------------- ### Catch LogicException from PasskeyAuthentication::isEnabled() Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/errors.md Shows how to safely check if passkey MFA is enabled, avoiding the LogicException by checking the contract first and catching it as a fallback. Uses PasskeyAuthentication::make()->isEnabled($user). ```php use Illuminate\Contracts\Auth\Authenticatable; use JeffersonGoncalves\Filament\MultiFactorPasskeys\Contracts\HasPasskeyAuthentication; use JeffersonGoncalves\Filament\MultiFactorPasskeys\PasskeyAuthentication; function isPasskeyMfaEnabled(Authenticatable $user): bool { if (! $user instanceof HasPasskeyAuthentication) { return false; // avoid the LogicException altogether } try { return PasskeyAuthentication::make()->isEnabled($user); } catch (LogicException) { return false; } } ``` -------------------------------- ### Register Spatie passkey routes in a service provider Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/endpoints.md Required for server round-trips during passkey authentication and registration. The package does not auto-register these routes despite README claims, so consumers must add this in a service provider. ```php use Illuminate\Support\Facades\Route; Route::passkeys(); // spatie/laravel-passkeys macro, web middleware group ``` -------------------------------- ### Manual provider registration in bootstrap/providers.php Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/multifactor-passkeys-service-provider.md Registers the MultiFactorPasskeysServiceProvider manually in bootstrap/providers.php. Auto-discovery makes this unnecessary in normal apps. ```php return [ App\Providers\AppServiceProvider::class, JeffersonGoncalves\Filament\MultiFactorPassKeys\MultiFactorPasskeysServiceProvider::class, ]; ``` -------------------------------- ### Register MultiFactorPasskeysPlugin on a Filament panel Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/multifactor-passkeys-plugin.md Use this to add the passkey login button to a Filament panel's login screen. Requires importing the plugin class and calling ->plugin(MultiFactorPasskeysPlugin::make()) inside the panel's panel() method. ```php use Filament\Panel; use JeffersonGoncalves\Filament\MultiFactorPasskeys\MultiFactorPasskeysPlugin; public function panel(Panel $panel): Panel { return $panel // ... ->plugin(MultiFactorPasskeysPlugin::make()); } ``` -------------------------------- ### Single-bind guard for authenticate Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/frontend-assets-and-views.md Registers the Livewire.on listener only once per component ID using a window-global Set to prevent duplicate listeners from firing startAuthentication and aborting in-flight ceremonies. ```javascript window.__fmfpAuthenticateBound = window.__fmfpAuthenticateBound || new Set(); if (! window.__fmfpAuthenticateBound.has($wire.id)) { window.__fmfpAuthenticateBound.add($wire.id); Livewire.on(/* ... */); } ``` -------------------------------- ### Synchronous storage failure test Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/livewire-register-passkey.md Livewire test that simulates a storage failure by passing invalid JSON to storePasskey, expecting a validation error on the name field. Demonstrates how ValidationException is surfaced. ```php use Livewire\Livewire; use JeffersonGoncalves\Filament\MultiFactorPasskeys\Livewire\RegisterPasskey; Livewire::test(RegisterPasskey::class, ['redirectUrl' => '/admin']) ->set('name', 'MacBook Touch ID') ->call('storePasskey', '{ invalid json }') ->assertHasErrors(['name']); // ValidationException surfaced on the name field ``` -------------------------------- ### Combine PasskeyAuthentication with MultiFactorPasskeysPlugin Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/passkey-authentication.md Registers PasskeyAuthentication with a custom redirect URL and adds the MultiFactorPasskeysPlugin to the panel. The panel configuration is abbreviated with a comment placeholder. ```php use Filament\Panel; use JeffersonGoncalves\Filament\MultiFactorPasskeys\MultiFactorPasskeysPlugin; use JeffersonGoncalves\Filament\MultiFactorPasskeys\PasskeyAuthentication; public function panel(Panel $panel): Panel { return $panel // ... ->multiFactorAuthentication([ PasskeyAuthentication::make()->redirectUrlUsing(fn () => route('welcome')), ]) ->plugin(MultiFactorPasskeysPlugin::make()); } ``` -------------------------------- ### Customise redirect URL using redirectUrlUsing Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/README.md Override the default redirect URL after successful registration or assertion. ```php PasskeyAuthentication::make() ->redirectUrlUsing(fn () => route('dashboard')); ``` -------------------------------- ### Disable logic closure from DisablePasskeyAuthenticationAction.php Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/actions.md Resolves the authenticated user via Filament::auth()->user(), deletes all passkey records inside a DB::transaction() (atomic), then sends a success Notification with title from notifications.disabled.title. ```php /** @var HasPasskeyAuthentication $user */ $user = Filament::auth()->user(); DB::transaction(function () use ($user): void { $user->passkeys()->delete(); }); Notification::make() ->title(__('filament-multifactor-passkeys::actions/disable.notifications.disabled.title')) ->success() ->icon(Heroicon::OutlinedLockOpen) ->send(); ``` -------------------------------- ### getChallengeFormComponents() method signature Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/passkey-authentication.md Declares the method that returns the schema component for the MFA challenge step during login. The $user parameter is required by the contract but not used in the body; the redirect comes from getRedirectUrl(). ```php public function getChallengeFormComponents(Authenticatable $user): array ``` -------------------------------- ### redirectUrlUsing() method signature Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/passkey-authentication.md Sets the closure used to resolve the post-ceremony redirect URL. Fluent — returns $this. Passing null clears the callback and restores fallback behavior. ```php public function redirectUrlUsing(?Closure $callback): static ``` -------------------------------- ### Catch ValidationException from storePasskey() Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/errors.md Wrap a programmatic call to RegisterPasskey::storePasskey() in try/catch to handle the ValidationException raised when passkey registration fails. The exception is thrown with a message on the 'name' field: 'We could not register your passkey. Please try again.' ```php use Illuminate\Validation\ValidationException; try { $component->storePasskey($attestationJson); } catch (ValidationException $e) { // $e->errors()['name'][0] => "We could not register your passkey. Please try again." } ``` -------------------------------- ### DisablePasskeyAuthenticationAction::make() Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/actions.md Builds the 'Turn off' action that deletes all of the authenticated user's passkeys inside a DB transaction, then sends a success notification. The $passkeyAuthentication parameter is accepted but unused by the body. ```APIDOC ## `DisablePasskeyAuthenticationAction::make()` ### Description Builds the "Turn off" action that deletes **all** of the authenticated user's passkeys inside a DB transaction, then sends a success notification. The `$passkeyAuthentication` parameter is accepted but unused by the body (this matches the signature emitted by `PasskeyAuthentication::getActions()`). ### Method `public static function make(PasskeyAuthentication $passkeyAuthentication): Action` ### Parameters - `$passkeyAuthentication` (PasskeyAuthentication) - Required - Accepted for signature symmetry with the setup factory; not referenced in the method body. ### Return `Filament\Actions\Action` ### Configuration applied (in chain order) - `Action::make(...)` - action name `'disablePasskeyAuthentication'` - `label()` - `filament-multifactor-passkeys::actions/disable.label` (English: `Turn off`) - `color()` - `'danger'` - `icon()` - `Heroicon::LockOpen` - `link()` - render style - `requiresConfirmation()` - confirmation modal before executing - `modalWidth()` - `Filament\Support\Enums\Width::Medium` - `modalIcon()` - `Heroicon::OutlinedLockOpen` - `modalHeading()` - `actions/disable.modal.heading` (English: `Disable passkey verification`) - `modalDescription()` - `actions/disable.modal.description` - `modalSubmitAction(...)` - relabels the confirm button from `actions/disable.modal.actions.submit.label` (English: `Disable passkey verification`) - `action(fn () => ...)` - executes the disable logic (below) - `rateLimit(5)` - throttles the action to 5 executions per time window (Laravel rate limiting middleware semantics) ### The disable logic (`action` closure, `src/Actions/DisablePasskeyAuthenticationAction.php:30-43`) ```php /** @var HasPasskeyAuthentication $user */ $user = Filament::auth()->user(); DB::transaction(function () use ($user): void { $user->passkeys()->delete(); }); Notification::make() ->title(__('filament-multifactor-passkeys::actions/disable.notifications.disabled.title')) ->success() ->icon(Heroicon::OutlinedLockOpen) ->send(); ``` Sequence: 1. Resolve the authenticated user via `Filament::auth()->user()`. 2. Delete every passkey relation record inside a `DB::transaction()` — the whole delete is atomic. 3. Send a success `Notification` (title from `notifications.disabled.title`). ### Example — running the disable routine outside the action ```php use Illuminate\Support\Facades\DB; use Filament\Notifications\Notification; use JeffersonGoncalves\Filament\MultiFactorPasskeys\Contracts\HasPasskeyAuthentication; use Filament\Facades\Filament; /** @var HasPasskeyAuthentication $user */ $user = Filament::auth()->user(); DB::transaction(function () use ($user): void { $user->passkeys()->delete(); }); // relies on the authenticated user implementing HasPasskeyAuthentication, // otherwise the passkeys() relation call fails at runtime ``` ``` -------------------------------- ### redirectUrlUsing() Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/passkey-authentication.md Sets the closure used to resolve the post-ceremony redirect URL. Fluent — returns `$this`. ```APIDOC ## `redirectUrlUsing()` ### Description Sets the closure used to resolve the post-ceremony redirect URL. Fluent — returns `$this`. ### Signature `redirectUrlUsing(?Closure $callback): static` ### Parameters - `$callback` (?Closure) - Required - Callable invoked with zero arguments that must return the redirect URL. Passing `null` clears the callback and restores the fallback behaviour. ### Source `src/PasskeyAuthentication.php:31-36` ``` -------------------------------- ### getChallengeFormComponents(Authenticatable $user) Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/passkey-authentication.md Returns an array of Filament form components for the MFA challenge step during login. These components handle the passkey verification. ```APIDOC ## getChallengeFormComponents(Authenticatable $user) ### Description Returns an array of Filament form components for the MFA challenge step during login. These components handle the passkey verification. ### Method `public function getChallengeFormComponents(Authenticatable $user): array` ### Parameters - **$user** (Authenticatable) - Required - The user attempting to authenticate. ### Return Value - **array** - An array of Filament form components. ``` -------------------------------- ### redirectUrlUsing(?Closure $callback) Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/passkey-authentication.md Sets a callback to customize the redirect URL after a successful passkey ceremony. The callback should return a string URL. ```APIDOC ## redirectUrlUsing(?Closure $callback) ### Description Sets a callback to customize the redirect URL after a successful passkey ceremony. The callback should return a string URL. ### Method `public function redirectUrlUsing(?Closure $callback): static` ### Parameters - **$callback** (?Closure) - Required - A closure that receives no arguments and returns a string URL. ### Return Value - **static** - The provider instance for chaining. ``` -------------------------------- ### getActions() Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/passkey-authentication.md Returns an array of Filament actions related to passkey management. These actions are used in the profile management schema. ```APIDOC ## getActions() ### Description Returns an array of Filament actions related to passkey management. These actions are used in the profile management schema. ### Method `public function getActions(): array` ### Return Value - **array** - An array of Filament action objects. ``` -------------------------------- ### getLoginFormLabel() method signature Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/passkey-authentication.md Returns the translated label shown on the login form for the MFA step, resolved from the language key `filament-multifactor-passkeys::provider.login_form.label`. Returns a string with English default 'Use a passkey'. ```php public function getLoginFormLabel(): string ``` -------------------------------- ### Register PasskeyAuthentication in a PanelProvider Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/passkey-authentication.md Adds PasskeyAuthentication to the multiFactorAuthentication array in a Filament panel. The panel configuration is abbreviated with a comment placeholder. ```php use Filament\Panel; use JeffersonGoncalves\Filament\MultiFactorPasskeys\PasskeyAuthentication; public function panel(Panel $panel): Panel { return $panel // ...panel configuration... ->multiFactorAuthentication([ PasskeyAuthentication::make(), ]); } ``` -------------------------------- ### Login button Blade view for passkey authentication Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/livewire-authenticate-passkey.md HTML button that triggers getOptions() via wire:click. The Blade view listens for the passkey-authentication-options-ready event, runs startAuthentication(), then calls authenticate() with the serialized assertion. ```html ``` -------------------------------- ### getLoginFormLabel() Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/passkey-authentication.md Returns the translated label shown on the login form for the MFA step, resolved from the language key 'filament-multifactor-passkeys::provider.login_form.label'. ```APIDOC ## getLoginFormLabel() ### Description Returns the translated label shown on the login form for the MFA step, resolved from the language key `filament-multifactor-passkeys::provider.login_form.label`. ### Method `getLoginFormLabel()` ### Return - **Type:** `string` - **Description:** Translated label (English default: `Use a passkey`). ### Source `src/PasskeyAuthentication.php:47-50` ``` -------------------------------- ### Class anatomy of MultiFactorPasskeysServiceProvider Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/multifactor-passkeys-service-provider.md Shows the public methods of the service provider class. The class extends Spatie\LaravelPackageTools\PackageServiceProvider and is auto-discovered via composer.json. ```php class MultiFactorPasskeysServiceProvider extends PackageServiceProvider { public function configurePackage(Package $package): void public function packageBooted(): void } ``` -------------------------------- ### getChallengeFormComponents(Authenticatable $user): array Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/passkey-authentication.md Returns the schema component rendered for the MFA challenge step during login inside Filament's MFA challenge form. The method emits a View component that renders the passkey authentication Blade view with the redirect URL. ```APIDOC ## getChallengeFormComponents(Authenticatable $user): array ### Description Returns the schema component rendered for the MFA challenge step during login (inside Filament's MFA challenge form). Emits a `Filament\Schemas\Components\View` rendering `filament-multifactor-passkeys::components.authenticate` with `viewData(['redirect' => $this->getRedirectUrl()])`. ### Method PHP method ### Signature ```php public function getChallengeFormComponents(Authenticatable $user): array ``` ### Parameters - **$user** (Illuminate\Contracts\Auth\Authenticatable) - Required - The user completing MFA. Declared by the contract but not referenced in the method body; the redirect is taken from `getRedirectUrl()`. ### Return - **array** - One `View` schema component (`[0]`). ### Source `src/PasskeyAuthentication.php:90-98` ### Example — registration in a PanelProvider ```php use Filament\Panel; use JeffersonGoncalves\Filament\MultiFactorPasskeys\PasskeyAuthentication; public function panel(Panel $panel): Panel { return $panel // ...panel configuration... ->multiFactorAuthentication([ PasskeyAuthentication::make(), ]); } ``` ### Example — combined with the login plugin ```php use Filament\Panel; use JeffersonGoncalves\Filament\MultiFactorPasskeys\MultiFactorPasskeysPlugin; use JeffersonGoncalves\Filament\MultiFactorPasskeys\PasskeyAuthentication; public function panel(Panel $panel): Panel { return $panel // ... ->multiFactorAuthentication([ PasskeyAuthentication::make()->redirectUrlUsing(fn () => route('welcome')), ]) ->plugin(MultiFactorPasskeysPlugin::make()); } ``` ``` -------------------------------- ### getRedirectUrl() method signature Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/passkey-authentication.md Resolves the URL for redirect after a successful WebAuthn ceremony. Uses the closure if set, otherwise falls back to the current panel's URL or '/'. ```php public function getRedirectUrl(): string ``` -------------------------------- ### LogicException message for missing HasPasskeyAuthentication contract Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/errors.md Exact error message raised by PasskeyAuthentication::isEnabled() when the user model does not implement the HasPasskeyAuthentication contract. Triggered during profile MFA rendering or direct calls. ```text The user model must implement the [JeffersonGoncalves\Filament\MultiFactorPasskeys\Contracts\HasPasskeyAuthentication] interface to use passkey authentication. ``` -------------------------------- ### getLoginFormLabel() Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/passkey-authentication.md Returns the label for the login form field associated with this provider. Used in the MFA challenge step. ```APIDOC ## getLoginFormLabel() ### Description Returns the label for the login form field associated with this provider. Used in the MFA challenge step. ### Method `public function getLoginFormLabel(): string` ### Return Value - **string** - The label text. ``` -------------------------------- ### getId() method signature Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/multifactor-passkeys-plugin.md Returns the plugin identifier 'filament-multifactor-passkeys'. ```php public function getId(): string ``` -------------------------------- ### getRedirectUrl() Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/api-reference/passkey-authentication.md Returns the redirect URL after a successful passkey ceremony. If a custom callback was set via redirectUrlUsing(), it is invoked; otherwise, a default URL is returned. ```APIDOC ## getRedirectUrl() ### Description Returns the redirect URL after a successful passkey ceremony. If a custom callback was set via redirectUrlUsing(), it is invoked; otherwise, a default URL is returned. ### Method `public function getRedirectUrl(): string` ### Return Value - **string** - The redirect URL. ``` -------------------------------- ### HasPasskeyAuthentication interface Source: https://github.com/jeffersongoncalves/filament-multifactor-passkeys/blob/2.x/_autodocs/types.md Interface that extends Spatie's HasPasskeys contract, requiring a hasPasskeyAuthentication() method returning bool. Used to indicate whether a user has passkey MFA enabled. ```php interface HasPasskeyAuthentication extends HasPasskeys { public function hasPasskeyAuthentication(): bool; } ```