{"id":16085737,"url":"https://github.com/infinitypaul/laravel-password-history-validation","last_synced_at":"2025-04-05T22:06:27.535Z","repository":{"id":45380592,"uuid":"246558918","full_name":"infinitypaul/laravel-password-history-validation","owner":"infinitypaul","description":"Prevent users from reusing recently used passwords","archived":false,"fork":false,"pushed_at":"2024-09-11T06:35:37.000Z","size":42,"stargazers_count":82,"open_issues_count":0,"forks_count":27,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-10T13:09:10.603Z","etag":null,"topics":["laravel","password","password-history","rules","validation"],"latest_commit_sha":null,"homepage":"https://medium.com/@infinitypaul","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/infinitypaul.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-11T11:59:11.000Z","updated_at":"2024-09-11T06:34:29.000Z","dependencies_parsed_at":"2024-06-20T23:29:13.739Z","dependency_job_id":"3ae1d434-87a3-4e61-bb94-c1766106aa84","html_url":"https://github.com/infinitypaul/laravel-password-history-validation","commit_stats":{"total_commits":24,"total_committers":5,"mean_commits":4.8,"dds":0.375,"last_synced_commit":"0cad25d05b9a535065f00a3218ca305c3e12eb0d"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinitypaul%2Flaravel-password-history-validation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinitypaul%2Flaravel-password-history-validation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinitypaul%2Flaravel-password-history-validation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinitypaul%2Flaravel-password-history-validation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/infinitypaul","download_url":"https://codeload.github.com/infinitypaul/laravel-password-history-validation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406087,"owners_count":20933803,"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","password","password-history","rules","validation"],"created_at":"2024-10-09T13:09:12.655Z","updated_at":"2025-04-05T22:06:27.487Z","avatar_url":"https://github.com/infinitypaul.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Password History Validation\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/infinitypaul/laravel-password-history-validation.svg?style=flat-square)](https://packagist.org/packages/infinitypaul/laravel-password-history-validation)\n[![Build Status](https://img.shields.io/travis/infinitypaul/laravel-password-history-validation/master.svg?style=flat-square)](https://travis-ci.org/infinitypaul/laravel-password-history-validation)\n[![Quality Score](https://img.shields.io/scrutinizer/g/infinitypaul/laravel-password-history-validation.svg?style=flat-square)](https://scrutinizer-ci.com/g/infinitypaul/laravel-password-history-validation)\n[![Total Downloads](https://img.shields.io/packagist/dt/infinitypaul/laravel-password-history-validation.svg?style=flat-square)](https://packagist.org/packages/infinitypaul/laravel-password-history-validation)\n\nPrevent users from reusing recently used passwords.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require infinitypaul/laravel-password-history-validation\n```\n\n## Configuration\n\nTo get started, you'll need to publish the config file, and  migrate the database:\n\n```bash\nphp artisan vendor:publish --tag=password-config\n```\nModify the config file according to your project, then migrate the database\n\n```bash\nphp artisan migrate\n```\n\n## Usage\nThis package will observe the created and updated event of the models (check the config file for settings) and records the password hashes automatically.\n\nIn Your Form Request or Inline Validation, All You Need To Do Is Instantiate The `NotFromPasswordHistory` class passing the current user as an argument\n``` php\n\u003c?php\nuse Infinitypaul\\LaravelPasswordHistoryValidation\\Rules\\NotFromPasswordHistory;\n\n$this-\u003evalidate($request, [\n            'password' =\u003e [\n                'required',\n                new NotFromPasswordHistory($request-\u003euser())\n            ]\n        ]);\n```\n\n### Cleaning Up Old Record - (Optional)\n\nBecause We Are Storing The Hashed Password In Your Database, Your Database Can Get Long When You Have Lots Of Users \n\nAdd PasswordHistoryTrait To Your User Model\n``` php\n\u003c?php\nuse Infinitypaul\\LaravelPasswordHistoryValidation\\Traits\\PasswordHistoryTrait;\n\nclass User extends Authenticatable\n{\n    use Notifiable, PasswordHistoryTrait;\n\n}\n```\nThen You Can Run The Following Artisan Command\n\n``` bash\nphp artisan password-history:clear\n```\n### Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email infinitypaul@live.com instead of using the issue tracker.\n\n\n## How can I thank you?\n\nWhy not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or HackerNews? Spread the word!\n\nDon't forget to [follow me on twitter](https://twitter.com/infinitypaul)!\n\nThanks!\nEdward Paul.\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%2Finfinitypaul%2Flaravel-password-history-validation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfinitypaul%2Flaravel-password-history-validation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinitypaul%2Flaravel-password-history-validation/lists"}