validate([ 'current_password' => ['required', 'current_password'], 'password' => ['required', 'confirmed', 'min:8'], ]); $request->user()->update(['password' => Hash::make($validated['password'])]); return back()->with('success', 'Kata laluan berjaya dikemaskini.'); } }