validate(User::$rules); User::create([ 'name' => $this->name, 'email' => Str::lower($this->email), 'password' => Hash::make($this->password) ]); session()->flash('success', 'Akun sudah dibuat.'); $this->redirectRoute('login'); } catch (QueryException $e) { Log::error($e); $this->dispatch('error', message: "Kesalahan Database {$e->errorInfo[1]}"); } } public function render() { return view('livewire.register'); } }