@@ -97,12 +97,12 @@ public function getTagNamesAttribute(): array
9797 * @param string|array $tagNames
9898 * @return void
9999 */
100- public function addTags ($ tagNames , $ locale = null )
100+ public function addTags ($ tagNames , $ locale = null , $ group = null )
101101 {
102102 $ tagNames = TaggingUtility::makeTagArray ($ tagNames );
103103
104104 foreach ($ tagNames as $ tagName ) {
105- $ this ->addSingleTag ($ tagName , $ locale );
105+ $ this ->addSingleTag ($ tagName , $ locale, $ group );
106106 }
107107 }
108108
@@ -112,9 +112,9 @@ public function addTags($tagNames, $locale = null)
112112 * @param string|array $tagNames
113113 * @return void
114114 */
115- public function tag ($ tagNames , $ locale = null )
115+ public function tag ($ tagNames , $ locale = null , $ group = null )
116116 {
117- $ this ->addTags ($ tagNames , $ locale );
117+ $ this ->addTags ($ tagNames , $ locale, $ group );
118118 }
119119
120120 /**
@@ -242,7 +242,7 @@ public function scopeWithoutTags(Builder $query, $tagNames): Builder
242242 *
243243 * @param string $tagName
244244 */
245- private function addSingleTag ($ tagName , $ locale = null )
245+ private function addSingleTag ($ tagName , $ locale = null , $ group = null )
246246 {
247247 $ tagName = trim ($ tagName );
248248
@@ -266,7 +266,7 @@ private function addSingleTag($tagName, $locale = null)
266266
267267 $ this ->tagged ()->save ($ tagged );
268268
269- TaggingUtility::incrementCount ($ tagName , $ tagSlug , 1 , $ locale );
269+ TaggingUtility::incrementCount ($ tagName , $ tagSlug , 1 , $ locale, $ group );
270270
271271 unset($ this ->relations ['tagged ' ]);
272272
0 commit comments