userId = auth()->user()->id; $this->name = auth()->user()->name; $this->email = auth()->user()->email; } public function submit() { try { $this->validate(); auth()->user()->update([ 'name' => $this->name, ]); $this->dispatch('success', 'Profile updated'); } catch (\Throwable $e) { return handleError($e, $this); } } public function render() { return view('livewire.profile.index'); } }