PHPackages                             starfolksoftware/password-history - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. starfolksoftware/password-history

AbandonedArchivedLibrary

starfolksoftware/password-history
=================================

Add password history to your laravel applications

v0.6.1(5y ago)02[1 issues](https://github.com/starfolksoftware/password-history/issues)MITPHPPHP ^7.4

Since Oct 15Pushed 5y ago1 watchersCompare

[ Source](https://github.com/starfolksoftware/password-history)[ Packagist](https://packagist.org/packages/starfolksoftware/password-history)[ Docs](https://github.com/StarfolkSoftware/password-history)[ GitHub Sponsors](https://github.com/starfolksoftware)[ RSS](/packages/starfolksoftware-password-history/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Add password history to your laravel applications
=================================================

[](#add-password-history-to-your-laravel-applications)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bfa8f0e025d025a77945be1bd0b164e33190edb5d4c9c218eeec38ad983a019c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73746172666f6c6b736f6674776172652f70617373776f72642d686973746f72792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/starfolksoftware/password-history)[![GitHub Tests Action Status](https://camo.githubusercontent.com/557167a487dab371e35890e5e1a48455e9ee149285e55845a1199c39671b4e74/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f73746172666f6c6b736f6674776172652f70617373776f72642d686973746f72792f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/starfolksoftware/password-history/actions?query=workflow%3Arun-tests+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/07220d008f385102f455babe47811ed947a1ebcf108adcd7c6051fb9e2f6e7f4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73746172666f6c6b736f6674776172652f70617373776f72642d686973746f72792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/starfolksoftware/password-history)

Add password history to your laravel applications

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require starfolksoftware/password-history
```

You can publish and run the migrations with:

```
php artisan vendor:publish --provider="StarfolkSoftware\PasswordHistory\PasswordHistoryServiceProvider" --tag="migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --provider="StarfolkSoftware\PasswordHistory\PasswordHistoryServiceProvider" --tag="config"
```

This is the contents of the published config file:

```
[
    /*
    * When using the "HasPasswordHistory" trait from this package, we need to know which
    * Eloquent model should be used to retrieve your roles. Of course, it
    * is often just the "PasswordHistory" model but you may use whatever you like.
    *
    * The model you want to use as a PasswordHistory model needs to implement the
    * `StarfolkSoftware\PasswordHistory\Contracts\PasswordHistory` contract.
    */
    'password_history_class' => \StarfolkSoftware\PasswordHistory\PasswordHistory::class,

    /**
     * The table name for password histories.
     */
    'table_name' => 'password_histories',

    /**
     * The models password column name
     */
    'models_password_column_name' => 'password',

    /**
     * Password change can not be the same with any password in the last
     * {{ password_history_check_length }} recent passwords
     */
    'password_history_check_length' => env('PASSWORD_HISTORY_CHECK_LENGTH', 5),

    /*
    * The user model that should be used. If null, the default user provider from your
    * Laravel authentication configuration will be used.
    */
    'user_model' => \Illuminate\Foundation\Auth\User::class,
]
```

Usage
-----

[](#usage)

### Registering models

[](#registering-models)

With this package, you can track password history of any model. To make your models `passwordhistorable`, add the `HasPasswordHistory` to the model classes as in the following

```
namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use StarfolkSoftware\PasswordHistory\Traits\HasPasswordHistory;

class User extends Model
{
    use HasPasswordHistory;
    ...
}
```

Password history is saved to the database the moment a `saved` event is fired on your model. Remember that also the `saved` event is fired when you first create a model.

### `NotInRecentPasswordHistory` validation rule

[](#notinrecentpasswordhistory-validation-rule)

If you want to validate that a password is not in the recent password history, you can use the `NotInRecentPasswordHistory` rule as in the following snippet:

```
use StarfolkSoftware\PasswordHistory\Rules\NotInRecentPasswordHistory;

validator(collect($model)->toArray(), [
    'password' => NotInRecentPasswordHistory::ofUser($model),
])->validate();
```

Testing
-------

[](#testing)

```
composer test
```

Psalming
--------

[](#psalming)

```
./vendor/bin/psalm --show-info=true
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Faruk Nasir](https://github.com/frknasir)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2040d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f609ab7be5e5a0089c8a3a52861fc379fd2038adb1190e0524c5f46a900fcf0?d=identicon)[starfolksoftware](/maintainers/starfolksoftware)

---

Top Contributors

[![frknasir](https://avatars.githubusercontent.com/u/4984175?v=4)](https://github.com/frknasir "frknasir (26 commits)")

---

Tags

password historystarfolksoftware

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/starfolksoftware-password-history/health.svg)

```
[![Health](https://phpackages.com/badges/starfolksoftware-password-history/health.svg)](https://phpackages.com/packages/starfolksoftware-password-history)
```

###  Alternatives

[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
