laravel-tagging icon indicating copy to clipboard operation
laravel-tagging copied to clipboard

Updating tag

Open casperwilkes opened this issue 5 years ago • 1 comments
trafficstars

Great package! I'm running into an issue with updating a tag. Maybe it's an architecture thing I'm missing conceptually? If you try to update a tag, it creates a new one instead of updating the current record.

It looks like you have to update both tagging_tags and tagging_tagged in order for an update to occur. Is there not an easier way to update both records in 1 call?

casperwilkes avatar Mar 06 '20 13:03 casperwilkes

$post->untag(); // first, remove old tags $post->tag($tags); // second, add new tags $post->save; // and update

KhurshidYakubov avatar Jan 05 '21 06:01 KhurshidYakubov

see also the retag method

rtconner avatar May 03 '23 02:05 rtconner