always-open/laravel-auth-notifications

一个Laravel包,用于在用户的密码、两步验证或登录状态发生变化时通知他们。

v1.0.1 2022-08-20 04:35 UTC

This package is auto-updated.

Last update: 2024-09-20 09:11:26 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

一个Laravel包,用于在用户的密码、两步验证或登录状态发生变化时通知他们。

安装

您可以通过composer安装此包

composer require always-open/laravel-auth-notifications

您可以使用以下命令发布配置文件

php artisan vendor:publish --provider="AlwaysOpen\AuthNotifications\AuthNotificationsServiceProvider" --tag="laravel-auth-notifications-config"

用法

默认情况下,所有通知都处于关闭状态。要启用它们,声明适当的环境变量,例如 AUTH_NOTIFICATIONS_LOGIN_VALIDATED=true。框架登录事件跟踪 Illuminate\Auth\Events\ValidatedIlluminate\Auth\Events\FailedIlluminate\Auth\Events\Lockout 事件。

对于凭证通知,我们只是监视用户模型的更改。如果您想手动触发这些事件,将对应字段设置为空字符串,并使用仅参数为要发送的用户对象的 AlwaysOpen\AuthNotifications\Events\LoginWasChangedAlwaysOpen\AuthNotifications\Events\PasswordWasChangedAlwaysOpen\AuthNotifications\Events\TwoFactorWasEnabledAlwaysOpen\AuthNotifications\Events\TwoFactorWasDisabled 进行触发。

您也可以通过创建自己的通知并覆盖 config/auth-notifications.php 中定义的类来覆盖发送的通知。使用 php artisan make:notification 创建自己的通知。

测试

composer test

贡献

有关详细信息,请参阅 CONTRIBUTING

安全漏洞

请查看我们的安全策略以了解如何报告安全漏洞: 安全策略

致谢

许可证

MIT许可证(MIT)。有关更多信息,请参阅 许可证文件