From 1c9068cfa99a0edab1d4521c0fbc5ffad9f85e86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Mon, 20 Jun 2022 16:17:38 +0300 Subject: [PATCH] Skip date column for SearchString --- app/View/Components/SearchString.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/View/Components/SearchString.php b/app/View/Components/SearchString.php index ae524cb70..394bf023e 100644 --- a/app/View/Components/SearchString.php +++ b/app/View/Components/SearchString.php @@ -18,6 +18,11 @@ class SearchString extends Component /** string */ public $model; + public $skip_columns = [ + 'created_at', + 'updated_at', + ]; + /** * Create a new component instance. * @@ -47,7 +52,12 @@ class SearchString extends Component foreach ($columns as $column => $options) { // This column skip for filter - if (!empty($options['searchable'])) { + if (! empty($options['searchable'])) { + continue; + } + + // This column skip for filter + if (in_array($column, $this->skip_columns)) { continue; }