artmin96 / filament-password-less
无密码 Filament
1.0.3
2023-07-17 11:24 UTC
Requires
- php: ^8.0|^8.1
- filament/filament: ^2.13
- illuminate/contracts: ^9.0|^10.0
- spatie/laravel-package-tools: ^1.14
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^6.0|^7.0
- nunomaduro/larastan: ^2.0
- orchestra/testbench: ^7.22|^8.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
README
Filament 无密码登录
无密码认证是使用除密码以外的其他方式验证软件用户身份的过程。
屏幕截图
安装
您可以通过 composer 安装此包
composer require artmin96/filament-password-less
更新 config/filament.php 以指向 PasswordLess Login::class
'auth' => [ 'guard' => env('FILAMENT_AUTH_GUARD', 'web'), 'pages' => [ 'login' => \ArtMin96\FilamentPasswordLess\Http\Livewire\Auth\Login::class, ], ],
您可以使用以下命令发布配置文件
php artisan vendor:publish --tag="filament-password-less-config"
这是发布配置文件的内容
return [ /** * Magic link * * Maybe you want to log in with a temporary generated link. * If yes, set it to true. */ 'using_magic_link' => false, /** * Rate limit count */ 'rate_limit_count' => 5, /** * Passphrase count * * Passphrase is a combination of 3 or 4 words separated by hyphens. */ 'passphrase_count' => 3, /** * Passphrase expiry (minutes) */ 'passphrase_expiry' => 15, /** * User model */ 'user_model' => \App\Models\User::class, /** * Login confirmation page component * * If you want to change something, place your component here. */ 'confirm_passphrase_component' => \ArtMin96\FilamentPasswordLess\Http\Livewire\Auth\Confirm::class, ];
可选地,您可以使用以下命令发布视图
php artisan vendor:publish --tag="filament-password-less-views"
用法
将 ArtMin96\FilamentPasswordLess\Traits\PasswordLessLogin
特性添加到您的 User
模型中
use Illuminate\Foundation\Auth\User as Authenticatable; use ArtMin96\FilamentPasswordLess\Traits\PasswordLessLogin; class User extends Authenticatable { use PasswordLessLogin; // ... }
测试
composer test
变更日志
请参阅 CHANGELOG 以获取有关最近更改的更多信息。
贡献
请参阅 CONTRIBUTING 以获取详细信息。
安全漏洞
请审查 我们的安全策略 了解如何报告安全漏洞。
致谢
许可
MIT 许可证 (MIT)。有关更多信息,请参阅 许可文件。