importar usuarios desde excel

This commit is contained in:
Felipe
2023-10-21 16:42:20 -05:00
parent 7db131cd67
commit ff00f91eed
6 changed files with 82 additions and 57 deletions
+5 -4
View File
@@ -1,6 +1,7 @@
<?php
namespace App\Http\Livewire;
use Livewire\WithFileUploads;
use Livewire\Component;
use App\Imports\UsersImport;
@@ -10,10 +11,10 @@ use App\Http\Controllers\Controller;
class Import extends Component
{
use WithFileUploads;
public $photo;
public $importado;
public function render()
{
return view('livewire.import');
@@ -21,8 +22,8 @@ class Import extends Component
public function import()
{
$data=Excel::import(new UsersImport, $this->photo);
$this->photo=null;
$data = Excel::import(new UsersImport, $this->photo);
$this->photo = null;
$this->importado = 'true';
// aquí se puede procesar los datos obtenidos
}
-11
View File
@@ -222,17 +222,6 @@ class ShowPlanes extends Component
/* ------------- CREAR ------------- */
public function createNewCuenta()
{
// $this->validate([
// 'servicio_newCuenta' => 'required',
// 'usuario_newCuenta' => 'required',
// 'password_newCuenta' => 'required',
// 'fecha_inicial' => 'required',
// 'fecha_final' => 'required',
// 'estado' => 'required',
// ]);
if ($consulta_cuenta = Cuentas::where('correo', $this->usuario_newCuenta)->exists()) {
$this->alert('warning', 'La cuenta ya existe', [
'position' => 'top'
+1
View File
@@ -289,6 +289,7 @@ class ShowPromociones extends Component
]);
}
$cuenta = null;
$this->modalComprarPromo = false;
}
}
if (count($this->f) > 0) {