diff --git a/app/Http/Livewire/ShowUsuarios.php b/app/Http/Livewire/ShowUsuarios.php index 8fd0a8e..e2bca74 100755 --- a/app/Http/Livewire/ShowUsuarios.php +++ b/app/Http/Livewire/ShowUsuarios.php @@ -247,12 +247,12 @@ class ShowUsuarios extends Component $this->validate(); - $consulta_user = User::where('email', $this->email)->exists(); + $consulta_user = User::where('email', strtolower(trim($this->email)))->exists(); if (!$consulta_user) { $crear = new User; $crear->name = $this->nombre; - $crear->email = $this->email; + $crear->email = strtolower(trim($this->email)); $crear->password = Hash::make($this->password); $crear->rol_id = $this->rol; $crear->subvendedor_id = Auth::user()->rol->nombre == "super" ? null : Auth::user()->id; @@ -570,7 +570,7 @@ class ShowUsuarios extends Component ); User::where('id', $this->id_edit)->update([ 'name' => $this->nombre_edit, - 'email' => $this->email_edit, + 'email' => strtolower(trim($this->email_edit)), 'rol_id' => $this->rol_edit ]);