laravel-tagging
laravel-tagging copied to clipboard
Updating tag
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?
$post->untag(); // first, remove old tags $post->tag($tags); // second, add new tags $post->save; // and update
see also the retag method