PHPackages                             zenepay/password-expiry - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. zenepay/password-expiry

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

zenepay/password-expiry
=======================

It handles password expiry of users.

1.0.1(1y ago)0173↓33.3%MITPHPPHP ^8.1

Since Oct 4Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/zenepay/password-expiry)[ Packagist](https://packagist.org/packages/zenepay/password-expiry)[ Docs](https://github.com/zenepay/password-expirable)[ RSS](/packages/zenepay-password-expiry/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Password Expiry for Laravel
===========================

[](#password-expiry-for-laravel)

Password expiry

- It allows you to set user password to expire in x days after creating/resetting.
- Using imanghafoori/laravel-password-history, user cannot use the last x previous paswords.
- Can use as middleware and validation
- It does support Laravel 9.x - 12.x

Install
-------

[](#install)

Via Composer

```
$ composer require zenepay/password-expiry
```

You need to migrate you database.

```
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Zenepay\PasswordExpiry\PasswordExpiryServiceProvider" --tag="config"
```

When published, the `config/password_history.php` config file contains:

```
return [

      'expiry_days' => 90
];
```

You can change it according to your needs.

Usage
-----

[](#usage)

- Include Following trait in User Model

```
use Zenepay\PasswordExpiry\Traits\PasswordExpirable;

class User extends Authenticatable {
    use PasswordExpirable;
}
```

- You can check if user password is expired?

```
$user->isPasswordExpired();
```

- You can protect your routes from user with expired password by :

For Laravel &lt; 11
===================

[](#for-laravel--11)

add following middleware to app/Http/Kernel.php

- To prevent user with password expire to access page. This will redirect to reset password page

```
use Zenepay\PasswordExpiry\CheckPasswordExpired;

protected $routeMiddleware = [
    ...
    'check-password-expired' => CheckPasswordExpired::class
]
```

For Laravel &gt;=11
===================

[](#for-laravel-11)

Add this to bootstrap/app.php

```
use Zenepay\PasswordExpiry\CheckPasswordExpired;

->withMiddleware(function (Middleware $middleware) {
     $middleware->append(CheckPasswordExpired::class);
})
```

For Laravel + Filament 3
========================

[](#for-laravel--filament-3)

For Laravel Filament 3, you can put to panel middleware

```
use Zenepay\PasswordExpiry\CheckPasswordExpired;

   $panel->authMiddleware([
        ...,
        CheckPasswordExpired::class
    ])
```

Validate to prevent using previous passwords
--------------------------------------------

[](#validate-to-prevent-using-previous-passwords)

In any validate for password rule, add NoPreviousPassword::ofUser($user) in

```
use Zenepay\PasswordExpiry\Rules\NoPreviousPassword;

    public function store(Request $request): RedirectResponse
    {
        $request->validate([
            ...
            'password' => ['required', 'confirmed',
            Rules\Password::defaults(),
            NoPreviousPassword::ofUser($request->user())],
        ]);
    }
```

In Filament with Breezy plugin and Profile page you can add rule as below

```
use Jeffgreco13\FilamentBreezy\BreezyCore;
use Zenepay\PasswordExpiry\Rules\NoPreviousPassword;
    $panel->plugins([
        BreezyCore::make()
        ->passwordUpdateRules(
            rules: [Password::default()->mixedCase()->uncompromised(3),NoPreviousPassword::ofUser(Auth::user())],
            requiresCurrentPassword: true,
        )
    ])
```

Change log
----------

[](#change-log)

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

Testing
-------

[](#testing)

```
$ composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email :author\_email instead of using the issue tracker.

Credits
-------

[](#credits)

- \[Iman\] for his great password history package
- \[Fahad Ali\] for is an inspireation of password-expirable package
- \[All Contributors\]\[link-contributors\]

License
-------

[](#license)

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

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance50

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Every ~174 days

Total

2

Last Release

411d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/514bdcdca020d9c3e9e50dc74ab9ad7f79283be106fb52f7adfd5595a4faba0d?d=identicon)[zenepay](/maintainers/zenepay)

---

Top Contributors

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

---

Tags

laravel-password-expiryZenepayPasswordExpiry

### Embed Badge

![Health badge](/badges/zenepay-password-expiry/health.svg)

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

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[olssonm/l5-very-basic-auth

Laravel stateless HTTP basic auth without the need for a database

1662.5M1](/packages/olssonm-l5-very-basic-auth)[stechstudio/laravel-jwt

Helper package that makes it easy to generate, consume, and protect routes with JWT tokens in Laravel

126117.6k](/packages/stechstudio-laravel-jwt)[scaler-tech/laravel-saml2

SAML2 Service Provider integration for Laravel applications, based on OneLogin toolkit

2737.5k](/packages/scaler-tech-laravel-saml2)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)

PHPackages © 2026

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