Skip to content

Commit f0a77b3

Browse files
Fix export on columns from eloquent relation (#29)
* fix issue with column from relationship not exporting 1. remove condition where $row is being check if not Model 2. use Array dot method insted of flatten. * Fix stan error on is_numeric method * Update change log * Fix pull request no. * update CHANGELOG * revert isNull param type
1 parent 7530ce4 commit f0a77b3

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## UNRELEASED
44

5+
## v0.13.1 - 08-04-2022
6+
7+
- Fix export on columns from eloquent relation #29
8+
59
## v0.13.0 - 08-04-2022
610

711
- Performance improvement #27

src/Jobs/DataTableExportJob.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,10 @@ public function handle()
126126
foreach ($query as $row) {
127127
$cells = [];
128128

129-
if (! $row instanceof Model) {
130-
$row = $row instanceof Arrayable ? $row->toArray() : (array) $row;
131-
}
129+
$row = $row instanceof Arrayable ? $row->toArray() : (array) $row;
132130

133131
if ($this->usesLazyMethod() && is_array($row)) {
134-
$row = Arr::flatten($row);
132+
$row = Arr::dot($row);
135133
}
136134

137135
$defaultDateFormat = strval(config('datatables-export.default_date_format', 'yyyy-mm-dd'));

0 commit comments

Comments
 (0)