tapp / filament-invite
从 Filament 控板邀请用户
v1.0.9
2024-08-07 17:56 UTC
Requires
- php: ^8.1
- filament/filament: ^3.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^8.1.1||^7.10.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^2.1
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
README
提供从 Filament 用户资源邀请用户的行为。
安装
您可以通过 composer 安装此包
composer require tapp/filament-invite
您可以使用以下方式发布配置
php artisan filament-invite:install
要求
- 实现了密码重置和电子邮件验证的用户模型(Laravel 默认)
用法
将邀请操作添加到表格中
public static function table(Table $table): Table { return $table ->actions([ \Tapp\FilamentInvite\Tables\InviteAction::make(), ]); }
表格外的邀请操作使用不同的类
protected function getHeaderActions(): array { return [ \Tapp\FilamentInvite\Actions\InviteAction::make(), ]; }
自定义
重置 URL
在用户模型上实现 getResetPasswordUrl
public function getResetPasswordUrl(string $token, array $parameters = []): string { return URL::signedRoute( 'filament.admin.auth.password-reset.reset', [ 'email' => $this->email, 'token' => $token, ...$parameters, ], ); }
通知
在用户模型上实现 sendPasswordSetNotification 方法
public function sendPasswordSetNotification($token) { Notification::send($this, new SetPassword($token)); }
测试
composer test
变更日志
请参阅 变更日志 了解最近的变化。
贡献
请参阅 贡献指南 了解详细信息。
安全漏洞
请查看 我们的安全策略 了解如何报告安全漏洞。
鸣谢
许可证
MIT 许可证 (MIT)。请参阅 许可证文件 了解更多信息。