forked from nathalie/pedi2
Usando CsvHelper
This commit is contained in:
parent
eb05a7de6a
commit
e3f2e63435
1 changed files with 2 additions and 6 deletions
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Helpers\CsvHelper as CsvHelperAlias;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
use League\Csv\Reader;
|
|
||||||
|
|
||||||
class GrupoDeCompraSeeder extends Seeder
|
class GrupoDeCompraSeeder extends Seeder
|
||||||
{
|
{
|
||||||
|
@ -14,11 +14,7 @@ class GrupoDeCompraSeeder extends Seeder
|
||||||
*/
|
*/
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
$csv = Reader::createFromPath(resource_path('csv/barrios.csv'), 'r');
|
$registros = CsvHelperAlias::getRecords('csv/barrios.csv');
|
||||||
$csv->setDelimiter("|");
|
|
||||||
$csv->setEnclosure("'");
|
|
||||||
$csv->setHeaderOffset(0);
|
|
||||||
$registros = $csv->getRecords();
|
|
||||||
$gdcToInsert = [];
|
$gdcToInsert = [];
|
||||||
$usersToInsert = [];
|
$usersToInsert = [];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue