Update ShowUsuarios.php
This commit is contained in:
@@ -247,12 +247,12 @@ class ShowUsuarios extends Component
|
|||||||
|
|
||||||
$this->validate();
|
$this->validate();
|
||||||
|
|
||||||
$consulta_user = User::where('email', $this->email)->exists();
|
$consulta_user = User::where('email', strtolower(trim($this->email)))->exists();
|
||||||
|
|
||||||
if (!$consulta_user) {
|
if (!$consulta_user) {
|
||||||
$crear = new User;
|
$crear = new User;
|
||||||
$crear->name = $this->nombre;
|
$crear->name = $this->nombre;
|
||||||
$crear->email = $this->email;
|
$crear->email = strtolower(trim($this->email));
|
||||||
$crear->password = Hash::make($this->password);
|
$crear->password = Hash::make($this->password);
|
||||||
$crear->rol_id = $this->rol;
|
$crear->rol_id = $this->rol;
|
||||||
$crear->subvendedor_id = Auth::user()->rol->nombre == "super" ? null : Auth::user()->id;
|
$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([
|
User::where('id', $this->id_edit)->update([
|
||||||
'name' => $this->nombre_edit,
|
'name' => $this->nombre_edit,
|
||||||
'email' => $this->email_edit,
|
'email' => strtolower(trim($this->email_edit)),
|
||||||
'rol_id' => $this->rol_edit
|
'rol_id' => $this->rol_edit
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user