mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-24 01:50:38 +00:00
added current password to the password changing form
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
namespace App\Users\Rules;
|
||||
|
||||
use Auth;
|
||||
use Hash;
|
||||
use Illuminate\Contracts\Validation\Rule;
|
||||
|
||||
class PasswordMatchWithCurrent implements Rule
|
||||
{
|
||||
/**
|
||||
* Determine if the validation rule passes.
|
||||
*/
|
||||
public function passes($attribute, $value): bool
|
||||
{
|
||||
return Hash::check($value, Auth::user()->password);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation error message.
|
||||
*/
|
||||
public function message(): string
|
||||
{
|
||||
return "Your current password doesn't match.";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user