Download the PHP package asdh/password-changed-notification without Composer
On this page you can find all versions of the php package asdh/password-changed-notification. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download asdh/password-changed-notification
More information about asdh/password-changed-notification
Files in asdh/password-changed-notification
Package password-changed-notification
Short Description A simple package to send mail notification to the user when their password is changed.
License MIT
Homepage https://github.com/asdh/password-changed-notification
Informations about the package password-changed-notification
Password Changed Notification
A simple package to send mail notification to the user when their password is changed.
Installation
You can install the package via composer:
Usage
After installing the package, you can go to your User
model or any other model that has password and email fields and use PasswordChangedNotificationTrait
trait and implement PasswordChangedNotificationContract
interface
Now whenever you change the password of the user, a mail will be automatically sent to that user. Isn't that easy.
By default the package will assume the columns name to be email
and password
. But if you have different column name for those fields then you can modify those as well.
Let's say you have the email
column as user_email
in your User
model or any other model, then you can add emailColumnName
method on the User
model and return user_email
from here like so:
You can also modify the password
column by adding this method.
You can also modify the name
column by adding this method. This will be used in the mail like Hi Adam
.
Further, if you want to modify the mail that is being sent to the user, you can publish the mail view using
The views view will now be published in resources/views/vendor/password-changed-notification/emails/password-changed-notification.blade.php
. You can modify this file as per your need and when mail is sent to the user, it will be used.
You can also create your own mailable (the one that you create using php artisan make:mail
command) and use that instead. For that you need to return the mailable that you have created by adding passwordChangedNotificationMail
method on the User
model and returning the mailable.
Testing
Credits
- Laratips
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of password-changed-notification with dependencies
spatie/laravel-package-tools Version ^1.9.2
illuminate/contracts Version ^8.73|^9.0