original_string: protected function applyRecursive($query, array $targetParts, $value, $isFirst = false)
      {
          if (count($targetParts) < 2) {
  
              if ($this->translated) {
                  return $this->applyTranslatedValue($query, head($targetParts), $value, $isFirst);
              }
  
              return $this->applyValue($query, head($targetParts), $value, null, $isFirst);
          }
  
          $relation = array_shift($targetParts);
  
          $whereHasMethod = ! $isFirst && $this->combineOr ? 'orWhereHas' : 'whereHas';
  
          return $query->{$whereHasMethod}(
              $relation,
              function ($query) use ($targetParts, $value) {
                  return $this->applyRecursive($query, $targetParts, $value, true);
              }
          );
      }
code: protected function applyRecursive($query, array $targetParts, $value, $isFirst = false)
      {
          if (count($targetParts) < 2) {
  
              if ($this->translated) {
                  return $this->applyTranslatedValue($query, head($targetParts), $value, $isFirst);
              }
  
              return $this->applyValue($query, head($targetParts), $value, null, $isFirst);
          }
  
          $relation = array_shift($targetParts);
  
          $whereHasMethod = ! $isFirst && $this->combineOr ? 'orWhereHas' : 'whereHas';
  
          return $query->{$whereHasMethod}(
              $relation,
              function ($query) use ($targetParts, $value) {
                  return $this->applyRecursive($query, $targetParts, $value, true);
              }
          );
      }
code_tokens: protected function applyRecursive ( $ query , array $ targetParts , $ value , $ isFirst = false ) { if ( count ( $ targetParts ) < 2 ) { if ( $ this -> translated ) { return $ this -> applyTranslatedValue ( $ query , head ( $ targetParts ) , $ value , $ isFirst ) ; } return $ this -> applyValue ( $ query , head ( $ targetParts ) , $ value , null , $ isFirst ) ; } $ relation = array_shift ( $ targetParts ) ; $ whereHasMethod = ! $ isFirst && $ this -> combineOr ? 'orWhereHas' : 'whereHas' ; return $ query -> { $ whereHasMethod } ( $ relation , function ( $ query ) use ( $ targetParts , $ value ) { return $ this -> applyRecursive ( $ query , $ targetParts , $ value , true ) ; } ) ; }
docstring: Applies a the filter value recursively for normalized target segments.
  
  @param Builder  $query
  @param string[] $targetParts
  @param mixed    $value
  @param bool     $isFirst      whether this is the first expression (between brackets)
  @return mixed
docstring_tokens: Applies a the filter value recursively for normalized target segments .