I have modified the blog demo so a logged in user only sees their posts and related tags.
I have added an author_id column to the tags table so I can associate tags to a specific user. The following code in Tag.php allows a user to add new unique tags and it properly increments a user’s existing tags. Right now, it will not add a tag if that same tag was already added by another user. I want it to create duplicate tags if added by multiple members with each including their author_id. How can I get it to add a new tag if the tag name already exists but does not belong to the logged in user?
It should be possible, but why don’t you leave Tag as it is, and add a many-to-many table UserTag?
That way, if a user creates a new tag, you create it in the Tag table, otherwise you don’t. And, in both cases, you create the relationship in UserTag.