Skip to content

Commit 4a2cafe

Browse files
authored
Merge pull request #177 from mrezagolestan/master
fix: use callback function if exportRender method is set
2 parents 3438d8b + c06bd75 commit 4a2cafe

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Transformers/DataArrayTransformer.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ protected function buildColumnByCollection(array $row, Collection $columns, stri
5252
$data = is_array($data) ? json_encode($data) : $this->decodeContent($data);
5353
}
5454

55-
$results[$title] = $data;
55+
if (isset($column->exportRender)) {
56+
$callback = $column->exportRender;
57+
$results[$title] = $callback($row, $data);
58+
} else {
59+
$results[$title] = $data;
60+
}
5661
}
5762
});
5863

0 commit comments

Comments
 (0)