
Add secure, passwordless login to Laravel 11 using passkeys with Face ID, Touch ID, and biometrics via Spatie's package.
Passkeys let users log in without needing a password, making things both safer and easier. Instead of typing a password, users can log in with things like Face ID, fingerprints, or device PINs. In this guide, we’ll show you how to add Laravel Passkeys to your app using the Spatie Laravel Passkeys package with the Laravel 11
Make sure you have:
git clone https://github.com/laravel/livewire-starter-kit.git
cd livewire-starter-kit
composer install
cp .env.example .env
php artisan key:generate
php artisan migrate
pnpm i && pnpm buildInstall the Spatie Laravel Passkeys package:
composer require spatie/laravel-passkeysuse Spatie\Passkey\Concerns\InteractsWithPasskeys;
use Spatie\Passkey\Contracts\HasPasskeys;
class User extends Authenticatable implements HasPasskeys
{
use InteractsWithPasskeys;
// ...
}php artisan vendor:publish --tag="passkeys-migrations"
php artisan migrateInstall the browser package for WebAuthn:
pnpm add @simplewebauthn/browserIn your resources/js/app.js, add:
import {
browserSupportsWebAuthn,
startAuthentication,
startRegistration,
} from '@simplewebauthn/browser';
window.browserSupportsWebAuthn = browserSupportsWebAuthn;
window.startAuthentication = startAuthentication;
window.startRegistration = startRegistration;Rebuild assets:
pnpm buildRoute::passkeys();<div class="flex flex-col justify-center items-center">
<x-authenticate-passkey>
<flux:button variant="primary" type="submit" class="w-full">
{{ __('Authenticate using passkey') }}
</flux:button>
</x-authenticate-passkey>
</div><x-layouts.app :title="__('Dashboard')">
<div class="flex flex-col flex-1 gap-4 rounded-xl w-full h-full">
<livewire:passkeys />
</div>
</x-layouts.app>Ensure .env contains the correct app URL (must be HTTPS):
APP_URL=https://livewire-starter-kit.testTo publish and customize the default views:
php artisan vendor:publish --tag=passkeys-viewsThis will allow you to tailor the UI to match your brand.
https://livewire-starter-kit.test/register and register with your email and password.Passkeys make logging in safer and easier by letting users skip passwords and use things like Face ID or fingerprints instead. With the Laravel Passkeys package, it’s simple to add this modern login method to your app—even in the Livewire Starter Kit.
More and more big companies like Google, Amazon, and GitHub are already moving to passkeys, and now you can too. It works great on phones and laptops using Face ID, Windows Hello, or Android’s biometric login.
Adding passkey support to your Laravel 11 app is a smart move to stay up-to-date and offer a better user experience.