Skip to content

Commit 1cdae4c

Browse files
author
jm-mwi
authored
Update CsvSeeder.php
Fixed location of the trim function.
1 parent c855d90 commit 1cdae4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Flynsarmy/CsvSeeder/CsvSeeder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public function readRow( array $row, array $mapping )
225225
$row_values[$dbCol] = NULL;
226226
}
227227
else {
228-
$row_values[$dbCol] = $row[$csvCol];
228+
$row_values[$dbCol] = $this->should_trim ? trim($row[$csvCol]) : $row[$csvCol];
229229
}
230230
}
231231

@@ -245,7 +245,7 @@ public function readRow( array $row, array $mapping )
245245
public function insert( array $seedData )
246246
{
247247
try {
248-
DB::table($this->table)->insert($this->should_trim ? trim($seedData) : $seedData);
248+
DB::table($this->table)->insert($seedData);
249249
} catch (\Exception $e) {
250250
Log::error("CSV insert failed: " . $e->getMessage() . " - CSV " . $this->filename);
251251
return FALSE;

0 commit comments

Comments
 (0)