public static function insertTags($selectedTags, $postID, $postType)
    {
        if(count($selectedTags)) {
            $tagsIDs = [];

            $newTagsRelations = [];
            foreach ($selectedTags as $langSlug => $selectedTagForLanguage){
                if($selectedTagForLanguage) {
                    foreach ($selectedTagForLanguage as $selectedTag){

                        //insert tag if it doesn't exist
                        if($selectedTag['tagID'] == 0) {
                            $tagSlug = str_slug($selectedTag['title'], '-');
                            $tagsID = DB::table('tags')->insertGetId(
                                [
                                'postTypeID' => $postType['postTypeID'],
                                'createdByUserID' => Auth::user()->userID,
                                'title' => $selectedTag['title'],
                                'description' => $selectedTag['description'],
                                'slug' => $tagSlug,
                                ]
                            );
                        }else{
                            $tagsID = $selectedTag['tagID'];
                        }

                        //add new tag relationship
                        $newTagsRelations[] = [
                          'tagID' => $tagsID,
                          'postID' => $postID,
                          'language' => $langSlug
                        ];
                        $tagsIDs[] = $tagsID;
                    }
                }
            }

            // if post is in the main database
            $insertedTags = (new TagRelation())->setTable($postType->slug.'_tags')->insert($newTagsRelations);
            if($insertedTags) {
                return $tagsIDs;
            }
        }
        return [];
    }