PHPackages                             mccahan/laravel-auto-rehash - 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. mccahan/laravel-auto-rehash

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

mccahan/laravel-auto-rehash
===========================

Automatically update Laravel password hashes as users authenticate

1.0.3(1y ago)05.3kMITPHP

Since Jun 2Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mccahan/laravel-auto-rehash)[ Packagist](https://packagist.org/packages/mccahan/laravel-auto-rehash)[ RSS](/packages/mccahan-laravel-auto-rehash/feed)WikiDiscussions main Synced 3w ago

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

Laravel Auto Rehash
===================

[](#laravel-auto-rehash)

The Laravel documentation makes reference to [checking whether rehashing is necessary on authentication](https://laravel.com/docs/9.x/hashing#determining-if-a-password-needs-to-be-rehashed) but leaves the process itself as an exercise to the reader. This library listens to the `Illuminate\Auth\Events\Attempting` emitted by some authentication techniques and automatically rehashes passwords as necessary when users log in, achieving a rolling password hash upgrade.

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

[](#installation)

`composer require mccahan/laravel-auto-rehash`

Usage
-----

[](#usage)

If you only need to listen to default `Attempting` events, you're all set.

Custom Event
------------

[](#custom-event)

The library includes a custom event you can dispatch if you want to automatically rehash passwords when you have user credentials in-hand but don't want to use the existing `Attempting` event (e.g. if you have other listeners on that event you don't want to fire).

To use, include the event class:

```
use McCahan\LaravelAutoRehash\Events\ValidUserCredentials;
```

Then dispatch where necessary, including the password and your User model:

```
// Announce that we have some valid credentials in hand for a valid user
event(new ValidUserCredentials($user, $request->get('password')));
```

Standing on the Shoulders of Giants
-----------------------------------

[](#standing-on-the-shoulders-of-giants)

Credit to [SamAsEnd/laravel-needs-auto-rehash](https://github.com/SamAsEnd/laravel-needs-auto-rehash) for their library that feels more robust but didn't easily have custom event support I need.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Total

4

Last Release

603d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2308923?v=4)[Ryan McCahan](/maintainers/mccahan)[@mccahan](https://github.com/mccahan)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/mccahan-laravel-auto-rehash/health.svg)

```
[![Health](https://phpackages.com/badges/mccahan-laravel-auto-rehash/health.svg)](https://phpackages.com/packages/mccahan-laravel-auto-rehash)
```

###  Alternatives

[illuminate/auth

The Illuminate Auth package.

9327.9M1.2k](/packages/illuminate-auth)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6753.6k5](/packages/hasinhayder-tyro)[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2013.2k](/packages/alajusticia-laravel-logins)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)[kolayik/auth

Kolay Auth

121.9k](/packages/kolayik-auth)

PHPackages © 2026

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