Skip to content

Commit c036a15

Browse files
committed
make_hidden => hidden
1 parent 15650f3 commit c036a15

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/DataTableAbstract.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ abstract class DataTableAbstract implements DataTable, Arrayable, Jsonable
5555
'filter' => [],
5656
'order' => [],
5757
'only' => null,
58-
'make_hidden' => [],
58+
'hidden' => [],
5959
];
6060

6161
/**
@@ -255,7 +255,7 @@ public function escapeColumns($columns = '*')
255255
*/
256256
public function makeHidden(array $attributes = [])
257257
{
258-
$this->columnDef['make_hidden'] = array_merge_recursive(array_get($this->columnDef, 'make_hidden', []), $attributes);
258+
$this->columnDef['hidden'] = array_merge_recursive(array_get($this->columnDef, 'hidden', []), $attributes);
259259

260260
return $this;
261261
}

src/Processors/DataProcessor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function __construct($results, array $columnDef, array $templates, $start
8282
$this->escapeColumns = $columnDef['escape'];
8383
$this->includeIndex = $columnDef['index'];
8484
$this->rawColumns = $columnDef['raw'];
85-
$this->makeHidden = $columnDef['make_hidden'];
85+
$this->makeHidden = $columnDef['hidden'];
8686
$this->templates = $templates;
8787
$this->start = $start;
8888
}
@@ -99,7 +99,7 @@ public function process($object = false)
9999
$indexColumn = config('datatables.index_column', 'DT_RowIndex');
100100

101101
foreach ($this->results as $row) {
102-
$data = Helper::convertToArray($row, ['make_hidden' => $this->makeHidden]);
102+
$data = Helper::convertToArray($row, ['hidden' => $this->makeHidden]);
103103
$value = $this->addColumns($data, $row);
104104
$value = $this->editColumns($value, $row);
105105
$value = $this->setupRowVariables($value, $row);

src/Utilities/Helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public static function getOrMethod($method)
156156
*/
157157
public static function convertToArray($row, $filters = [])
158158
{
159-
$row = method_exists($row, 'makeHidden') ? $row->makeHidden(array_get($filters, 'make_hidden', [])) : $row;
159+
$row = method_exists($row, 'makeHidden') ? $row->makeHidden(array_get($filters, 'hidden', [])) : $row;
160160
$data = $row instanceof Arrayable ? $row->toArray() : (array) $row;
161161

162162
foreach ($data as &$value) {

0 commit comments

Comments
 (0)