https://github.com/always-open/laravel-auth-notifications
A Laravel package to notify your users when their password, two-factor authentication, or login status changes.
https://github.com/always-open/laravel-auth-notifications
auth authentication laravel package php8
Last synced: 9 months ago
JSON representation
A Laravel package to notify your users when their password, two-factor authentication, or login status changes.
- Host: GitHub
- URL: https://github.com/always-open/laravel-auth-notifications
- Owner: always-open
- License: mit
- Created: 2021-10-30T01:20:28.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-06T04:51:06.000Z (over 1 year ago)
- Last Synced: 2025-03-23T05:04:00.467Z (over 1 year ago)
- Topics: auth, authentication, laravel, package, php8
- Language: PHP
- Homepage:
- Size: 55.7 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# Laravel Auth Notifications
[](https://packagist.org/packages/always-open/laravel-auth-notifications)
[](https://github.com/always-open/laravel-auth-notifications/actions?query=workflow%3Arun-tests+branch%3Amain)
[](https://github.com/always-open/laravel-auth-notifications/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
[](https://packagist.org/packages/always-open/laravel-auth-notifications)
---
A Laravel package to notify your users when their password, two-factor authentication, or login status changes.
## Installation
You can install the package via composer:
```bash
composer require always-open/laravel-auth-notifications
```
You can publish the config file with:
```bash
php artisan vendor:publish --provider="AlwaysOpen\AuthNotifications\AuthNotificationsServiceProvider" --tag="laravel-auth-notifications-config"
```
## Usage
By default all of the notifications are turned off. To enable them, declare the appropriate environment variable like `AUTH_NOTIFICATIONS_LOGIN_VALIDATED=true`. Framework login events track the `Illuminate\Auth\Events\Validated`, `Illuminate\Auth\Events\Failed`, and `Illuminate\Auth\Events\Lockout` events.
For credential notifications, we are simply watching the user model for changes. If you'd rather fire those events manually, set the corresponding field to a blank string and dispatch `AlwaysOpen\AuthNotifications\Events\LoginWasChanged`, `AlwaysOpen\AuthNotifications\Events\PasswordWasChanged`, `AlwaysOpen\AuthNotifications\Events\TwoFactorWasEnabled`, or `AlwaysOpen\AuthNotifications\Events\TwoFactorWasDisabled` with the only parameter being the user object to send to.
You may also override the notifications that are sent by creating your own notifications via `php artisan make:notification` and overriding the class defined in the `config/auth-notifications.php`.
## Testing
```bash
composer test
```
## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Tom Schlick](https://github.com/tomschlick)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.