protected function parseTags($rawTags, string $group = null, string $locale = null, $create = false): array
    {
        (is_iterable($rawTags) || is_null($rawTags)) || $rawTags = [$rawTags];

        [$strings, $tags] = collect($rawTags)->map(function ($tag) {
            ! is_numeric($tag) || $tag = (int) $tag;

            ! $tag instanceof Model || $tag = [$tag->getKey()];
            ! $tag instanceof Collection || $tag = $tag->modelKeys();
            ! $tag instanceof BaseCollection || $tag = $tag->toArray();

            return $tag;
        })->partition(function ($item) {
            return is_string($item);
        });

        return $tags->merge(app('rinvex.tags.tag')->{$create ? 'findByNameOrCreate' : 'findByName'}($strings->toArray(), $group, $locale)->pluck('id'))->toArray();
    }