src/Taggable.php
public function retag($tagNames)
    {
        $tagNames = static::$taggingUtility->makeTagArray($tagNames);
        $currentTagNames = $this->tagNames();

        $deletions = array_diff($currentTagNames, $tagNames);
        $additions = array_diff($tagNames, $currentTagNames);

        $this->untag($deletions);

        foreach($additions as $tagName) {
            $this->addTag($tagName);
        }
    }
public function retag($tagNames)
    {
        $tagNames = static::$taggingUtility->makeTagArray($tagNames);
        $currentTagNames = $this->tagNames();

        $deletions = array_diff($currentTagNames, $tagNames);
        $additions = array_diff($tagNames, $currentTagNames);

        $this->untag($deletions);

        foreach($additions as $tagName) {
            $this->addTag($tagName);
        }
    }
public function retag ( $ tagNames ) { $ tagNames = static :: $ taggingUtility -> makeTagArray ( $ tagNames ) ; $ currentTagNames = $ this -> tagNames ( ) ; $ deletions = array_diff ( $ currentTagNames , $ tagNames ) ; $ additions = array_diff ( $ tagNames , $ currentTagNames ) ; $ this -> untag ( $ deletions ) ; foreach ( $ additions as $ tagName ) { $ this -> addTag ( $ tagName ) ; } }
Replace the tags from this model

@param string|array $tagNames
Replace the tags from this model