tmd/laravel-password-updater

Handles password verification and re-hashing passwords that may be hashed by outdated methods.

Installs: 67

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/tmd/laravel-password-updater

0.0.2 2016-10-09 16:01 UTC

This package is auto-updated.

Last update: 2025-09-28 12:55:39 UTC


README

Handles password verification and re-hashing passwords that may be hashed by outdated methods.

Setup

composer require tmd/laravel-password-updater

Usage

(Overly simplified example.)

<?php

use Tmd\LaravelPasswordUpdater\PasswordHasher;

public function login(PasswordHasher $passwordHasher)
{
    /** @var User $user */
    $user = User::where('username', $credentials['username'])->first();

    if (!$user) {
        return ['username' => ['There is no account with that username.']];
    }

    if (!$passwordHasher->verify($credentials['password'], $user, 'password')) {
        return ['password' => ['That password is not correct.']];
    }

    // Password is correct.
}