diff --git a/src/Filters/Client/ProjectSettingFilter.php b/src/Filters/Client/ProjectSettingFilter.php index 96c7aaa..ac5b15a 100644 --- a/src/Filters/Client/ProjectSettingFilter.php +++ b/src/Filters/Client/ProjectSettingFilter.php @@ -6,9 +6,11 @@ class ProjectSettingFilter extends QueryFilter { - public function of_key($key = '') + public function of_keys($keys = '') { - return $key ? $this->builder->ofKey($key) : $this->builder; + $keysArray = explode(',', $keys); + + return $keys ? $this->builder->ofKeys($keysArray) : $this->builder; } public function of_type($typeId = '') diff --git a/src/Http/Resources/Client/ProjectSettingResource.php b/src/Http/Resources/Client/ProjectSettingResource.php index 90a19e8..880e6df 100644 --- a/src/Http/Resources/Client/ProjectSettingResource.php +++ b/src/Http/Resources/Client/ProjectSettingResource.php @@ -23,12 +23,12 @@ public function toArray($request) 'name' => $this->name, 'value' => $this->when(! \in_array($this->projectSettingType->name, ['phone', 'image']), $this->value), - 'translatable' => $this->isTranslatable, + // 'translatable' => $this->isTranslatable, 'phone' => $this->when($this->projectSettingType->name == 'phone', new PhoneResource($this->phone)), 'image' => $this->when($this->projectSettingType->name == 'image', new MediaResource($this->mainImage)), 'type' => new ProjectSettingTypeResource($this->projectSettingType), - 'section' => new ProjectSettingSectionSimpleResource($this->projectSettingSection), + // 'section' => new ProjectSettingSectionSimpleResource($this->projectSettingSection), ]; } } diff --git a/src/Models/ProjectSetting.php b/src/Models/ProjectSetting.php index 26c5469..ed939c2 100644 --- a/src/Models/ProjectSetting.php +++ b/src/Models/ProjectSetting.php @@ -82,6 +82,11 @@ public function scopeOfKey($query, $key = '') $query->where('key', $key); } + public function scopeOfKeys($query, array $keys = []) + { + $query->whereIn('key', $keys); + } + public function scopeOfType($query, int $typeId = 0) { $query->where('project_setting_type_id', $typeId);