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
}