validate([ 'name' => ['string', 'min:3', 'max:191'], 'email' => ['email', 'string', 'min:3', 'max:191'], ]); auth()->user()->update([ 'name' => $request->name, 'email' => $request->email, ]); return redirect()->route('profile')->with('success', 'Data berhasil diupdate!'); } /** * Remove the specified resource from storage. */ public function delete(User $user, string $id) { $user = User::findorfail($id); $user->delete(); return back()->withWarning('Data Berhasil Dihapus!'); } }