Replies: 2 comments
-
just try to compare the tag name with the user you want to tag, it works in me. ex: $user->name == $tag->name |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hey, @Gigamick your intuition is correct. use Spatie\Tags\Tag; $tag = Tag::findOrCreate('my tag'); $first_post = Post::first()->attachTag('my tag'); $random_post = Post::find(23)->attachTags(['my tag', 'another tag']); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Say I have a model - Post
I will have many "posts" and I want to tag some "posts" with "tag 1" and I want to tag other posts with "tag 2" and I want to tag some posts with both "tag 1" and "tag 2". Is this possible with Spatie tags?
It seems to me that I can only tag the whole model, which isn't very useful to me. But I am 99% sure I am wrong.
Can anyone clarify?
Beta Was this translation helpful? Give feedback.
All reactions