original_string: protected function hydrateTags($tags, bool $createMissing = false): Collection
      {
          $tags = static::prepareTags($tags);
          $isTagsStringBased = static::isTagsStringBased($tags);
          $isTagsIntBased = static::isTagsIntBased($tags);
          $field = $isTagsStringBased ? 'slug' : 'id';
          $className = static::getTagClassName();
  
          if ($isTagsStringBased && $createMissing) {
              return $className::findManyByNameOrCreate($tags);
          }
  
          return $isTagsStringBased || $isTagsIntBased ? $className::query()->whereIn($field, (array) $tags)->get() : collect($tags);
      }
code: protected function hydrateTags($tags, bool $createMissing = false): Collection
      {
          $tags = static::prepareTags($tags);
          $isTagsStringBased = static::isTagsStringBased($tags);
          $isTagsIntBased = static::isTagsIntBased($tags);
          $field = $isTagsStringBased ? 'slug' : 'id';
          $className = static::getTagClassName();
  
          if ($isTagsStringBased && $createMissing) {
              return $className::findManyByNameOrCreate($tags);
          }
  
          return $isTagsStringBased || $isTagsIntBased ? $className::query()->whereIn($field, (array) $tags)->get() : collect($tags);
      }
code_tokens: protected function hydrateTags ( $ tags , bool $ createMissing = false ) : Collection { $ tags = static :: prepareTags ( $ tags ) ; $ isTagsStringBased = static :: isTagsStringBased ( $ tags ) ; $ isTagsIntBased = static :: isTagsIntBased ( $ tags ) ; $ field = $ isTagsStringBased ? 'slug' : 'id' ; $ className = static :: getTagClassName ( ) ; if ( $ isTagsStringBased && $ createMissing ) { return $ className :: findManyByNameOrCreate ( $ tags ) ; } return $ isTagsStringBased || $ isTagsIntBased ? $ className :: query ( ) -> whereIn ( $ field , ( array ) $ tags ) -> get ( ) : collect ( $ tags ) ; }
docstring: Hydrate tags.
  
  @param int|string|array|\ArrayAccess|\Rinvex\Taggable\Tag $tags
  @param bool                                               $createMissing
  
  @return \Illuminate\Support\Collection
docstring_tokens: Hydrate tags .