From 7589b66af2c45e9894da21f040f5e3f8f8cf72c8 Mon Sep 17 00:00:00 2001 From: Arjay Angeles Date: Mon, 2 Oct 2023 18:20:28 +0800 Subject: [PATCH 1/2] fix: cs --- src/Html/SearchPane.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Html/SearchPane.php b/src/Html/SearchPane.php index b93d023..a462ba8 100644 --- a/src/Html/SearchPane.php +++ b/src/Html/SearchPane.php @@ -223,9 +223,7 @@ public function hideTotal(bool $value = true): static */ public function modelOptions(EloquentBuilder|string $model, string $value, string $key = 'id'): SearchPane { - return $this->options( - Options::model($model, $value, $key) - ); + return $this->options(Options::model($model, $value, $key)); } /** @@ -261,9 +259,7 @@ public function tableOptions( Closure $callback = null, string $connection = null ): static { - return $this->options( - Options::table($table, $value, $key, $callback, $connection) - ); + return $this->options(Options::table($table, $value, $key, $callback, $connection)); } /** From 30e1e16db78cc2f5e74d89eb331022ac57ee4031 Mon Sep 17 00:00:00 2001 From: Arjay Angeles Date: Mon, 2 Oct 2023 18:22:40 +0800 Subject: [PATCH 2/2] feat: add collapse method --- src/Html/SearchPane.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Html/SearchPane.php b/src/Html/SearchPane.php index a462ba8..7589b6d 100644 --- a/src/Html/SearchPane.php +++ b/src/Html/SearchPane.php @@ -321,4 +321,16 @@ public function orthogonal(array|string $value): static return $this; } + + /** + * @param boolean $value + * @return $this + * @see https://datatables.net/reference/option/searchPanes.collapse + */ + public function collapse(bool $value = true): static + { + $this->attributes['collapse'] = $value; + + return $this; + } }