Skip to content

Commit 4824645

Browse files
authored
Fix export when used with eloquent builder.
1 parent 12a46c8 commit 4824645

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Exports/DataTableQueuedExport.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,22 @@ public function map($row): array
4343
return $this->columns
4444
->map(function (Column $column, $index) use ($row) {
4545
$property = $column['data'];
46-
$row = (array) $row;
4746

48-
if ($row[$property] instanceof \DateTime) {
47+
if ($row->{$property} instanceof \DateTime) {
4948
$this->dates[] = $index;
5049

51-
return Date::dateTimeToExcel($row[$property]);
50+
return Date::dateTimeToExcel($row->{$property});
5251
}
5352

5453
if ($this->wantsDateFormat($column)) {
5554
$this->dates[] = $index;
5655

57-
$dateValue = $row[$property];
56+
$dateValue = $row->{$property};
5857

5958
return $dateValue ? Date::dateTimeToExcel(Carbon::parse($dateValue)) : '';
6059
}
6160

62-
return $row[$property];
61+
return $row->{$property};
6362
})
6463
->toArray();
6564
}

0 commit comments

Comments
 (0)