diff --git a/src/HasTags.php b/src/HasTags.php index 801cb24..78beab7 100644 --- a/src/HasTags.php +++ b/src/HasTags.php @@ -287,9 +287,8 @@ protected function syncTagIds($ids, string | null $type = null, $detaching = tru // Attach any new ids $attach = array_unique(array_diff($ids, $current)); if (count($attach) > 0) { - collect($attach)->each(function ($id) { - $this->tags()->attach($id, []); - }); + $this->tags()->attach($attach, []); + $isUpdated = true; }