feat(chat): pedir cédula y celular al crear cuenta desde el chat

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro
2026-07-14 01:06:05 +00:00
co-authored by Claude Sonnet 4.6
parent a693ce2527
commit 5f06c27869
3 changed files with 35 additions and 7 deletions
+17 -6
View File
@@ -31,6 +31,8 @@ class PublicChat extends Component
public string $paso = 'email'; // email | verificacion | registro | chat
public string $email = '';
public string $nombreRegistro = '';
public string $cedulaRegistro = '';
public string $celularRegistro = '';
public string $codigoIngresado = '';
public ?string $emailMascarado = null;
public ?int $contactIdPending = null; // contact.id mientras espera verificacion
@@ -55,6 +57,8 @@ class PublicChat extends Component
protected $rules = [
'email' => 'required|email|max:100',
'nombreRegistro' => 'required|max:80',
'cedulaRegistro' => 'nullable|max:20',
'celularRegistro' => 'nullable|max:20',
'codigoIngresado' => 'nullable|digits:6',
];
@@ -95,14 +99,19 @@ class PublicChat extends Component
public function crearCuenta(): void
{
$this->validate([
'email' => 'required|email|max:100',
'nombreRegistro' => 'required|max:80',
'email' => 'required|email|max:100',
'nombreRegistro' => 'required|max:80',
'cedulaRegistro' => 'nullable|max:20',
'celularRegistro' => 'nullable|max:20',
]);
$user = User::create([
'name' => $this->nombreRegistro,
'email' => $this->email,
'password' => \Illuminate\Support\Facades\Hash::make(\Illuminate\Support\Str::random(16)),
'password' => Hash::make(Str::random(16)),
'cedula' => $this->cedulaRegistro ?: null,
'celular' => $this->celularRegistro ?: null,
'estado' => 'activo',
]);
$contact = ChatContact::create([
@@ -121,9 +130,11 @@ class PublicChat extends Component
public function rechazarRegistro(): void
{
$this->email = '';
$this->nombreRegistro = '';
$this->paso = 'email';
$this->email = '';
$this->nombreRegistro = '';
$this->cedulaRegistro = '';
$this->celularRegistro = '';
$this->paso = 'email';
}
// ─────────────────────────────────────────────────────────