Maintenance Reset Password

This commit is contained in:
Pusdatin BPKD Jkt
2022-10-11 15:57:42 +07:00
parent c33d9c73e2
commit 534368a6d5
3 changed files with 40 additions and 1 deletions
@@ -9,6 +9,8 @@ use App\Models\RoleUser;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
use Str;
use Hash;
class MstPenggunaController extends Controller
{
@@ -166,4 +168,21 @@ class MstPenggunaController extends Controller
return redirect()->route('users.index')
->with('success','Lock upload data sudah diubah!');
}
public function resetPass(User $user)
{
$random = Str::random(8);
$updateValue = [
"f_locked" => null,
// "recovery_password" => $random,
"password" => Hash::make($user->nrk),
"password_changed" => null,
"first_login" => date("Y-m-d H:i")
];
$user->update($updateValue);
return redirect()->route('users.index')
->with('success','Kata sandi sudah direset!');
}
}