update($user, $request->validated())) { return redirect() ->route('admin.profile.edit') ->with('status', 'profile-updated'); } } catch (Exception $e) { return back()->withInput()->withErrors(['error' => $e->getMessage()]); } return back()->withInput()->with('error', 'Failed to update profile.'); } }