{"id":21168601,"url":"https://github.com/laratipsofficial/password-changed-notification","last_synced_at":"2025-07-09T18:31:38.024Z","repository":{"id":41874802,"uuid":"439067110","full_name":"Laratipsofficial/password-changed-notification","owner":"Laratipsofficial","description":"If you want to see how this package is build, have a look at the YouTube playlist.","archived":false,"fork":false,"pushed_at":"2023-10-09T09:54:35.000Z","size":52,"stargazers_count":28,"open_issues_count":3,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-05T04:51:12.544Z","etag":null,"topics":["laravel","php"],"latest_commit_sha":null,"homepage":"https://www.youtube.com/playlist?list=PL2DahmvUpeuu8HkpbNT-cKernolVdqZq_","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Laratipsofficial.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null},"funding":{"github":"Asdh"}},"created_at":"2021-12-16T17:04:52.000Z","updated_at":"2022-06-21T06:21:51.000Z","dependencies_parsed_at":"2023-02-16T05:46:07.271Z","dependency_job_id":null,"html_url":"https://github.com/Laratipsofficial/password-changed-notification","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":"spatie/package-skeleton-laravel","purl":"pkg:github/Laratipsofficial/password-changed-notification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laratipsofficial%2Fpassword-changed-notification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laratipsofficial%2Fpassword-changed-notification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laratipsofficial%2Fpassword-changed-notification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laratipsofficial%2Fpassword-changed-notification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Laratipsofficial","download_url":"https://codeload.github.com/Laratipsofficial/password-changed-notification/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laratipsofficial%2Fpassword-changed-notification/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264502387,"owners_count":23618587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","php"],"created_at":"2024-11-20T15:16:12.163Z","updated_at":"2025-07-09T18:31:36.687Z","avatar_url":"https://github.com/Laratipsofficial.png","language":"PHP","funding_links":["https://github.com/sponsors/Asdh"],"categories":[],"sub_categories":[],"readme":"# Password Changed Notification\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/asdh/password-changed-notification.svg?style=flat-square)](https://packagist.org/packages/asdh/password-changed-notification)\n[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/asdh/password-changed-notification/run-tests?label=tests)](https://github.com/asdh/password-changed-notification/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/asdh/password-changed-notification/Check%20\u0026%20fix%20styling?label=code%20style)](https://github.com/asdh/password-changed-notification/actions?query=workflow%3A\"Check+%26+fix+styling\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/asdh/password-changed-notification.svg?style=flat-square)](https://packagist.org/packages/asdh/password-changed-notification)\n\nA simple package to send mail notification to the user when their password is changed.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require asdh/password-changed-notification\n```\n\n## Usage\n\nAfter 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\n\n```php\nuse Asdh\\PasswordChangedNotification\\Contracts\\PasswordChangedNotificationContract;\nuse Asdh\\PasswordChangedNotification\\Traits\\PasswordChangedNotificationTrait;\n\nclass User extends Authenticatable implements PasswordChangedNotificationContract\n{\n    use PasswordChangedNotificationTrait;\n}\n```\n\nNow whenever you change the password of the user, a mail will be automatically sent to that user. Isn't that easy.\n\nBy 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.\n\nLet'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:\n\n```php\npublic function emailColumnName(): string\n{\n    return 'user_email';\n}\n```\n\nYou can also modify the `password` column by adding this method.\n\n```php\npublic function passwordColumnName(): string\n{\n    return 'user_password';\n}\n```\n\nYou can also modify the `name` column by adding this method. This will be used in the mail like Hi `Adam`.\n\n```php\npublic function nameColumnName(): string\n{\n    return 'full_name';\n}\n```\n\nFurther, if you want to modify the mail that is being sent to the user, you can publish the mail view using\n\n```bash\nphp artisan vendor:publish --tag=\"password-changed-notification-views\"\n```\n\nThe 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.\n\nYou 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.\n\n```php\npublic function passwordChangedNotificationMail(): Mailable\n{\n    return new YourOwnPasswordChangedNotificationMail($this);\n}\n```\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Credits\n\n-   [Laratips](https://github.com/Laratipsofficial)\n-   [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaratipsofficial%2Fpassword-changed-notification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaratipsofficial%2Fpassword-changed-notification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaratipsofficial%2Fpassword-changed-notification/lists"}