Files
Epicnabbo-Catalogus-Updated…/cms update/app/Rules/CurrentPasswordRule.php
T
Remco b67e0ec2b9 🆙 Add fixed cms 🆙
2026-02-02 19:30:21 +01:00

22 lines
505 B
PHP

<?php
namespace App\Rules;
use Closure;
use Illuminate\Contracts\Validation\InvokableRule;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
class CurrentPasswordRule implements InvokableRule
{
/**
* Run the validation rule.
*/
public function __invoke(string $attribute, mixed $value, Closure $fail): void
{
if (! Hash::check($value, Auth::user()->password)) {
$fail('It seems like your current password is wrong.');
}
}
}