statview / filament-passkeys
0.1.11
2024-05-23 08:45 UTC
Requires
- illuminate/support: ^10
- web-auth/webauthn-lib: ^4.7
README
安装
安装此包
composer require statview/filament-passkeys
运行迁移
php artisan migrate
运行 Filament 的资产命令
php artisan filament:assets
将 HasPasskeys
特性添加到用户模式
<?php use Statview\Passkeys\Concerns\HasPasskeys; class User extends Model { use HasPasskeys; ...
从 CSRF 检查中排除 passkeys
路由
<?php class VerifyCsrfToken extends Middleware { /** * The URIs that should be excluded from CSRF verification. * * @var array<int, string> */ protected $except = [ 'passkeys/*', ]; }
将我们的插件添加到您的 Filament 上下文
<?php use Statview\Passkeys\PasskeysPlugin; class AdminPanel extends PanelProvider { public function panel(Panel $panel): Panel { return $panel // ... ->plugin(PasskeysPlugin::make()) // ... } }
鸣谢
受以下文章的启发并创建: https://blog.joe.codes/implementing-passkey-authentication-in-your-laravel-app