public function scopeDynamicFilter(Builder $query, string $filter_id, array $values, string $lang): Builder 	{ 		return $query->whereHas('productFilters', function ($query) use ($values, $filter_id, $lang) { 			$whereIn = [];  			foreach ($values as $operand => $value) { 				if ($value == null) { 					continue; 				}  				if (is_int($operand)) { 					$whereIn[] = $value;  					continue; 				}  				if ($operand == 'like') { 					$value = '%' . preg_replace('/\s+/', '%', $value) . '%'; 				}  				$query = $query->when($lang == 'hr', function ($query) use ($operand, $value) { 					$query->where('value', $operand, $value); 				}, function ($query) use ($operand, $value) { 					$query->whereHas('translations', function ($query) use ($operand, $value) { 						$query->where('value', $operand, $value); 					}); 				}); 			}  			$query->when(!empty($whereIn), function ($query) use ($whereIn, $lang) { 				$query->when($lang == 'hr', function ($query) use ($whereIn) { 					$query->whereIn('value', $whereIn); 				}, function ($query) use ($whereIn) { 					$query->whereHas('translations', function ($query) use ($whereIn) { 						$query->whereIn('value', $whereIn); 					}); 				}); 			}) 			->whereHas('categoryFilter', function ($query) use ($filter_id) { 				$query->whereHas('filter', function ($query) use ($filter_id) { 					$query->searchable()->where('id', $filter_id); 				}); 			}); 		}); 	}