fix(chat): usuarios creados desde el chat reciben rol 'cliente'
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
a9d8253800
commit
65c569b333
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Livewire\Chat;
|
||||
|
||||
use App\Mail\ChatOtpMail;
|
||||
use App\Models\Role;
|
||||
use App\Models\Cuentas;
|
||||
use App\Models\ChatContact;
|
||||
use App\Models\ChatConversation;
|
||||
@@ -131,6 +132,8 @@ class PublicChat extends Component
|
||||
'celularRegistro' => 'nullable|max:20',
|
||||
]);
|
||||
|
||||
$rolCliente = Role::where('nombre', 'cliente')->first();
|
||||
|
||||
$user = User::create([
|
||||
'name' => $this->nombreRegistro,
|
||||
'email' => $this->email,
|
||||
@@ -138,6 +141,7 @@ class PublicChat extends Component
|
||||
'cedula' => $this->cedulaRegistro ?: null,
|
||||
'celular' => $this->celularRegistro ?: null,
|
||||
'estado' => 'activo',
|
||||
'rol_id' => $rolCliente?->id,
|
||||
]);
|
||||
|
||||
$contact = ChatContact::create([
|
||||
|
||||
Reference in New Issue
Block a user