Download .zip |
Info | Documentation | View files (26) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2020-03-11 (1 month ago) | Not yet rated by the users | Total: 33 This week: 1 | All time: 9,846 This week: 364 |
Version | License | PHP version | Categories | |||
laravel-password-his 1.0 | Custom (specified... | 5 | PHP 5, User Management, Libraries, Se... |
Prevent users from reusing recently used passwords.
You can install the package via composer:
composer require infinitypaul/laravel-password-history-validation
To get started, you'll need to publish the config file, and migrate the database:
php artisan vendor:publish --tag=password-history
Modify the config file according to your project, then migrate the database
php artisan migrate
This package will observe the created and updated event of the models (check the config file for settings) and records the password hashes automatically.
In Your Form Request or Inline Validation, All You Need To Do Is Instantiate The NotFromPasswordHistory
class passing the current user as an argument
<?php
use Infinitypaul\LaravelPasswordHistoryValidation\Models\PasswordHistoryRepo;
$this->validate($request, [
'password' => [
'required',
new NotFromPasswordHistory($request->user())
]
]);
Because We Are Storing The Hashed Password In Your Database, Your Database Can Get Long When You Have Lots Of Users
Add PasswordHistoryTrait To Your User Model
<?php
use Infinitypaul\LaravelPasswordHistoryValidation\Traits\PasswordHistoryTrait;
class User extends Authenticatable
{
use Notifiable, PasswordHistoryTrait;
}
Then You Can Run The Following Artisan Command
php artisan password-history:clear
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email infinitypaul@live.com instead of using the issue tracker.
Why 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!
Don't forget to follow me on twitter!
Thanks! Edward Paul.
The MIT License (MIT). Please see License File for more information.
Files |
File | Role | Description | ||
---|---|---|---|---|
.idea (5 files) | ||||
config (1 file) | ||||
database (1 directory) | ||||
src (1 file, 5 directories) | ||||
tests (1 file) | ||||
.editorconfig | Data | Auxiliary data | ||
.phpunit.result.cache | Data | Auxiliary data | ||
.scrutinizer.yml | Data | Auxiliary data | ||
.styleci.yml | Data | Auxiliary data | ||
.travis.yml | Data | Auxiliary data | ||
CHANGELOG.md | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
CONTRIBUTING.md | Data | Auxiliary data | ||
LICENSE.md | Lic. | License text | ||
phpunit.xml | Data | Auxiliary data | ||
README.md | Doc. | Documentation |
Files | / | .idea |
File | Role | Description |
---|---|---|
laravel-password-history-validation.iml | Data | Auxiliary data |
misc.xml | Data | Auxiliary data |
modules.xml | Data | Auxiliary data |
php.xml | Data | Auxiliary data |
vcs.xml | Data | Auxiliary data |
Files | / | database | / | migrations |
File | Role | Description |
---|---|---|
2019_12_02_141717_...d_history_table.php | Class | Class source |
Files | / | src |
Files | / | src | / | Models |
File | Role | Description |
---|---|---|
PasswordHistory.php | Class | Class source |
PasswordHistoryRepo.php | Class | Class source |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.