PHPackages                             eightynine/filament-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. eightynine/filament-password-expiry

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

eightynine/filament-password-expiry
===================================

Allow your users to periodically reset their passwords, to enforce security.

3.0.2(1y ago)74.0k↓52.8%6[1 issues](https://github.com/eighty9nine/filament-password-expiry/issues)MITPHPPHP ^8.1

Since Jul 18Pushed 1y ago2 watchersCompare

[ Source](https://github.com/eighty9nine/filament-password-expiry)[ Packagist](https://packagist.org/packages/eightynine/filament-password-expiry)[ Docs](https://github.com/eightynine/filament-password-expiry)[ GitHub Sponsors](https://github.com/eightynine)[ RSS](/packages/eightynine-filament-password-expiry/feed)WikiDiscussions 3.x Synced 2d ago

READMEChangelog (3)Dependencies (7)Versions (4)Used By (0)

Filament Password Expiry
========================

[](#filament-password-expiry)

🛠️ Be Part of the Journey
-------------------------

[](#️-be-part-of-the-journey)

Hi, I'm Eighty Nine. I created password expiry plugin to solve real problems I faced as a developer. Your sponsorship will allow me to dedicate more time to enhancing these tools and helping more people. [Become a sponsor](https://github.com/sponsors/eighty9nine) and join me in making a positive impact on the developer community.

Allow your users to periodically reset their passwords, to enforce security.
----------------------------------------------------------------------------

[](#allow-your-users-to-periodically-reset-their-passwords-to-enforce-security)

This package allows you to periodically reset your users passwords, to enforce security. In your system you have to force users to change their passwords every 30-90 days. This ensures that even if the user is no longer using the system, other people will not be able to login with their old password.

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

[](#installation)

You can install the package via composer:

```
composer require eightynine/filament-password-expiry
```

### Add the plugin to your panel

[](#add-the-plugin-to-your-panel)

1. In you panel's provider, add the plugin as:

```
use EightyNine\FilamentPasswordExpiry\PasswordExpiryPlugin;

    public function panel(Panel $panel): Panel
    {
        return $panel
            ...
            ->plugin(PasswordExpiryPlugin::make());

    }
```

2. Publish the migrations and config file in order to set up the password expiry table and column.

```
php artisan vendor:publish --tag="password-expiry-migrations"
php artisan vendor:publish --tag="password-expiry-config"
php artisan migrate
```

If you need to, you can publish the translation file using the command:

```
php artisan vendor:publish --tag="password-expiry-translations"
```

3. In your authentication class, example `app/Models/User.php`, add the has password expiry trait to the model, the trait checks if all is setup correctly and will throw an exception if not. The trait will update the password\_expires\_at column when the user is created.

```
use EightyNine\FilamentPasswordExpiry\Concerns\HasPasswordExpiry;

class User extends Authenticatable
{
    use HasPasswordExpiry;
    ...
}
```

4. This plugin does not hash passwods when creating a new password. Instead, make sure your password is cast as 'hashed' in your User model

```
    /**
     * Get the attributes that should be cast.
     *
     * @return array
     */
    protected function casts(): array
    {
        return [
            'email_verified_at' => 'datetime',
            'password' => 'hashed',
        ];
    }
```

You are all good to go! Now when a user is created, the password\_expires\_at column will be updated with the current date and time plus the expires\_in config value. When the user tries to login, the middleware will check if the password\_expires\_at column is less than the current date and time. If it is, the user will be redirected to the password expiry page.

This is the contents of the published config file:

```
return [

    /**
     * Table
     *
     * The table to store the password expiry data in.
     */
    'table_name' => 'users',

    /**
     * Column
     *
     * The column to store the password expiry data in.
     */
    'column_name' => 'password_expires_at',

    /**
     * Password column name
     *
     * The name of the password column, will be updated when setting the new password.
     */
    'password_column_name' => 'password',

    /**
     * Expiry
     *
     * The number of days before the password expires.
     */
    'expires_in' => 30,

    /**
     * Password expiry route
     *
     * The route to redirect to when the password expires.
     */
    'password_expiry_route' => 'password-expiry.reset-password',

    /**
     * Password expiry path
     *
     * The path to redirect to when the password expires.
     */
    'password_expiry_path' => 'password-expiry/reset-password',

    /**
     * Password expiry middleware
     *
     * The middleware to use for password expiry.
     */
    'password_expiry_middleware' => PasswordExpiryMiddleware::class,

    /**
     * Password expiry middleware
     *
     * The middleware to use for password expiry.
     */
    'password_reset_page' => ResetPassword::class,

    /**
     * Auth class
     *
     * The auth class to use for password expiry. By default, the package uses Filament::auth()->user(). Make sure the auth class
     * also contains the column defined in the table_name config.
     */
    'auth_class' => Filament::class,

    /**
     * Email column
     *
     * The column to store the email in.
     */
    'email_column_name' => 'email',

    /**
     * After password reset redirect to
     *
     * The route to redirect to after a password reset. By default, the user will be redirected to the login page
     * using "Filament::getLoginUrl()"
     */
    'after_password_reset_redirect' => null,

    /**
     * Override login route
     *
     * There is a bug in laravel where when you change password, the user is redirected to the login page by default. This override
     * fixes that bug by defining a login route that redirects to your panel's login page.
     */
    'override_login_route' => true,

    /**
     * Change password after first login
     */
    'change_password_first_login' => false,
];
```

Credits
-------

[](#credits)

- [Eighty Nine](https://github.com/eighty9nine)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~71 days

Total

4

Last Release

501d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/97078bfe6be687082f9d2e8cf2ba73dfaff4efb25cd4c7572c1ebd9c7e9fcbae?d=identicon)[eighty9nine](/maintainers/eighty9nine)

---

Top Contributors

[![eighty9nine](https://avatars.githubusercontent.com/u/137639046?v=4)](https://github.com/eighty9nine "eighty9nine (8 commits)")[![mwakalingajohn](https://avatars.githubusercontent.com/u/14811728?v=4)](https://github.com/mwakalingajohn "mwakalingajohn (8 commits)")[![drlopes](https://avatars.githubusercontent.com/u/84995988?v=4)](https://github.com/drlopes "drlopes (4 commits)")[![sourcecodeit](https://avatars.githubusercontent.com/u/22499359?v=4)](https://github.com/sourcecodeit "sourcecodeit (1 commits)")

---

Tags

laraveleightyninefilament-password-expiry

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

84215.9k9](/packages/stephenjude-filament-two-factor-authentication)[marcelweidum/filament-passkeys

Use passkeys in your filamentphp app

6649.5k1](/packages/marcelweidum-filament-passkeys)[solution-forest/filament-email-2fa

filament-email-2fa

3211.0k](/packages/solution-forest-filament-email-2fa)[stephenjude/filament-feature-flags

Filament implementation of feature flags and segmentation with Laravel Pennant.

122177.8k1](/packages/stephenjude-filament-feature-flags)[stephenjude/filament-jetstream

A Laravel starter kit built with Filament inspired by Jetstream.

17760.2k3](/packages/stephenjude-filament-jetstream)

PHPackages © 2026

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