Closed motion-work closed 5 years ago
when I tested it locally here, it inserted only new and did not delete existing. but that is some weeks ago
possibly... if all of your tags belong to this user... if you then retag.. all would be deleted, i think..
perhaps check the $user
with dd($user);
and check the taggable_id
in the tagging_tagged table
This was happening to me as well, and it turned out to be because the tags were not used and the config value, delete_unused_tags
was set to true
. Setting delete_unused_tags
to false
resolved my problem.
on mine it says Call to a member function retag() on integer
the code
$tags = array("tag 1 updte","tag 2 update"); $post = Post::find($id); $post->retag($tags);
check what $post
is, with dd($post);
or dump($post);
And add use \Conner\Tagging\Taggable;
to the Post model.
Yeah I don't know why delete_unused_tags
is true by default. That should not be a default behavior. Setting that to false.
I want to update a users tags. For that I am using the retag() method. The retag() method deletes the whole tagging_tags table and inserts the new tags.
Shouldn't it only update the tagging_tagged table? Or am I doing something wrong?