Code Duplication    Length = 8-8 lines in 2 locations

app/Models/Traits/HasTags.php 2 locations

@@ 118-125 (lines=8) @@
115
     *
116
     * @return $this
117
     */
118
    public function attachTags($tags)
119
    {
120
        $tags = collect(Tag::findOrCreate($tags));
121
122
        $this->tags()->syncWithoutDetaching($tags->pluck('id')->toArray());
123
124
        return $this;
125
    }
126
127
    /**
128
     * @param string|\CachetHQ\Cachet\Models\Tag $tag
@@ 170-177 (lines=8) @@
167
     *
168
     * @return $this
169
     */
170
    public function syncTags($tags)
171
    {
172
        $tags = collect(Tag::findOrCreate($tags));
173
174
        $this->tags()->sync($tags->pluck('id')->toArray());
175
176
        return $this;
177
    }
178
179
    /**
180
     * Convert a list of tags into a collection of \CachetHQ\Cachet\Models\Tag.