Skip to content

Commit 405e267

Browse files
committed
Quick fix for orthogonal column data
yajra/laravel-datatables-html@c6cc9a7
1 parent 526a192 commit 405e267

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Transformers/DataArrayTransformer.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ protected function buildColumnByCollection(array $row, Collection $columns, stri
4040
$columns->each(function (Column $column) use ($row, $type, &$results) {
4141
if ($column[$type]) {
4242
$title = $column->title;
43-
$data = $row[$column->data] ?? '';
43+
if (is_array($column->data)) {
44+
$data = $row[$column->data['filter'] ?? $column->name] ?? '';
45+
} else {
46+
$data = $row[$column->data] ?? '';
47+
}
4448

4549
if ($type == 'exportable') {
4650
$title = $this->decodeContent($title);

0 commit comments

Comments
 (0)