back()->with('error', 'User not found'); } $request->validate([ 'username' => 'required', 'password' => 'required|min:6', 'confirm-password' => 'required|same:password', ]); $user->username = $request->input('username'); $user->password = Hash::make($request->input('password')); $user->save(); return redirect()->back()->with('success', 'Profil berhasil diperbarui'); } /** * Remove the specified resource from storage. */ public function destroy(string $id) { // } }