Laravel 11, Vuexy Admin 10.3, by admin@koneko.mx
This commit is contained in:
29
modules/Admin/App/Actions/Fortify/ResetUserPassword.php
Normal file
29
modules/Admin/App/Actions/Fortify/ResetUserPassword.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\App\Actions\Fortify;
|
||||
|
||||
use Laravel\Fortify\Contracts\ResetsUserPasswords;
|
||||
use Modules\Admin\App\Models\User;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
class ResetUserPassword implements ResetsUserPasswords
|
||||
{
|
||||
use PasswordValidationRules;
|
||||
|
||||
/**
|
||||
* Validate and reset the user's forgotten password.
|
||||
*
|
||||
* @param array<string, string> $input
|
||||
*/
|
||||
public function reset(User $user, array $input): void
|
||||
{
|
||||
Validator::make($input, [
|
||||
'password' => $this->passwordRules(),
|
||||
])->validate();
|
||||
|
||||
$user->forceFill([
|
||||
'password' => Hash::make($input['password']),
|
||||
])->save();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user