Skip to content

Commit 7a4f8c7

Browse files
authored
Merge pull request #206 from yajra/dtsp-collapse
feat: add dtsp collapse option setter
2 parents 8dbfa91 + 30e1e16 commit 7a4f8c7

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/Html/SearchPane.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,7 @@ public function hideTotal(bool $value = true): static
223223
*/
224224
public function modelOptions(EloquentBuilder|string $model, string $value, string $key = 'id'): SearchPane
225225
{
226-
return $this->options(
227-
Options::model($model, $value, $key)
228-
);
226+
return $this->options(Options::model($model, $value, $key));
229227
}
230228

231229
/**
@@ -261,9 +259,7 @@ public function tableOptions(
261259
Closure $callback = null,
262260
string $connection = null
263261
): static {
264-
return $this->options(
265-
Options::table($table, $value, $key, $callback, $connection)
266-
);
262+
return $this->options(Options::table($table, $value, $key, $callback, $connection));
267263
}
268264

269265
/**
@@ -325,4 +321,16 @@ public function orthogonal(array|string $value): static
325321

326322
return $this;
327323
}
324+
325+
/**
326+
* @param boolean $value
327+
* @return $this
328+
* @see https://datatables.net/reference/option/searchPanes.collapse
329+
*/
330+
public function collapse(bool $value = true): static
331+
{
332+
$this->attributes['collapse'] = $value;
333+
334+
return $this;
335+
}
328336
}

0 commit comments

Comments
 (0)