user = Auth::user(); } public function showProfile() { $user = $this->user; return view("auth.profile", compact("user")); } public function updateProfile(ProfileRequest $request) { $inputs = $request->only('name', 'email'); $data = ['name' => $inputs['name']]; if ($inputs['email'] !== $this->user->email) { $data['email'] = $inputs['email']; $data['email_verified_at'] = null; $data['remember_token'] = null; } $this->user->update($data); return redirect()->route("dashboard")->with("success", "Profile updated successfully."); } }