From adf9446fc381e7a9b7cc779aa68879d7288c44ea Mon Sep 17 00:00:00 2001 From: merdan Date: Fri, 15 Sep 2023 14:42:39 +0500 Subject: [PATCH] search fix --- config/scout.php | 5 ++++- packages/Sarga/Brand/src/Models/Brand.php | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/config/scout.php b/config/scout.php index 3fa4c9964..f4a935fc5 100644 --- a/config/scout.php +++ b/config/scout.php @@ -124,7 +124,10 @@ return [ 'sortableAttributes' => ['name','created_at','min_price'], // Other settings fields... ], - + Sarga\Brand\Models\Brand::class => [ +// 'filterableAttributes'=> ['type' ], + 'sortableAttributes' => ['name','position'], + ] ], ], diff --git a/packages/Sarga/Brand/src/Models/Brand.php b/packages/Sarga/Brand/src/Models/Brand.php index 221386196..413093279 100644 --- a/packages/Sarga/Brand/src/Models/Brand.php +++ b/packages/Sarga/Brand/src/Models/Brand.php @@ -43,13 +43,15 @@ class Brand extends Model implements BrandContract return [ 'id' => $this->id, 'name' => $this->name, - 'type' => 'brand' + 'type' => 'brand', + 'position' => $this->position, + ]; } public function shouldBeSearchable() { - return true; + return $this->status; } /**