importar usuarios desde excel
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -289,6 +289,7 @@ class ShowPromociones extends Component
|
||||
]);
|
||||
}
|
||||
$cuenta = null;
|
||||
$this->modalComprarPromo = false;
|
||||
}
|
||||
}
|
||||
if (count($this->f) > 0) {
|
||||
|
||||
Reference in New Issue
Block a user