Skip to content

Commit 1467b2c

Browse files
committed
Use searchPane instead of searchPanes.
1 parent 76ba163 commit 1467b2c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/DataTableAbstract.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -942,17 +942,19 @@ protected function getPrimaryKeyName()
942942
}
943943

944944
/**
945+
* Add a search pane options on response.
946+
*
945947
* @param string $column
946948
* @param mixed $options
947-
* @param \Closure|null $builder
949+
* @param callable|null $builder
948950
* @return $this
949951
*/
950-
public function searchPanes($column, $options, callable $builder = null)
952+
public function searchPane($column, $options, callable $builder = null)
951953
{
954+
$options = value($options);
955+
952956
if ($options instanceof Arrayable) {
953957
$options = $options->toArray();
954-
} else {
955-
$options = value($options);
956958
}
957959

958960
$this->searchPanes[$column]['options'] = $options;

tests/Integration/QueryDataTableTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ protected function setUp(): void
371371
$options = User::select('id as value', 'name as label')->get();
372372

373373
return $dataTable->query(DB::table('users'))
374-
->searchPanes('name', $options)
374+
->searchPane('name', $options)
375375
->toJson();
376376
});
377377
}

0 commit comments

Comments
 (0)