Laravel has introduced native passkey authentication support through new first-party packages:
服务器端
使用
Laravel\Passkeys\Contracts\PasskeyUser
;使用
Laravel\Passkeys\PasskeyAuthenticatable
;班级
用户
延伸
可验证
实现
PasskeyUser{
使用
PasskeyAuthenticatable
;}
laravel/passkeys-server is published on Packagist as laravel/passkeys. It brings migrations, routes for login, confirmation, and credential management, plus WebAuthn actions, events, and escape hatches when you need custom authorization, responses, or your own route definitions.
Client Side
进口
{ Passkeys }
从
'@laravel/passkeys'// Registration (authenticated user)等待
Passkeys.
登记
({ 姓名:
'My MacBook'
})// Verification (login)等待
Passkeys.
verify
()
@laravel/passkeys handles browser ceremonies—registration and verification—with a small core API and first-class helpers for React, Vue, and Svelte, including SSR-safe hooks so client-only APIs do not fight your framework.
强化
Laravel Fortify integrates the stack behind Features::passkeys() and a passkeys section in config/fortify.php, so Fortify apps get the same endpoints and contracts (PasskeyUser, PasskeyAuthenticatable) without reimplementing glue.
Together: server package, npm client, and Fortify line up on routes and contracts so passwordless auth stays boring to wire up and portable across stacks.







