Able to create duplicate tags with Tag::create() #483
Unanswered
code-reflex
asked this question in
Q&A
Replies: 1 comment 1 reply
-
This is a problem for us too, the slug field should be handled with spatie/laravel-sluggable to allow generating at least unique slugs |
Beta Was this translation helpful? Give feedback.
1 reply
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Was experimenting with Laravel-tags package and noticed that we can create duplicate tags i.e., tags with same name.
Ideally, we should not be able to create additional tags with the same name.
PS: There is no issue when you try to attach a tag multiple times with a model i.e., $user1->attachTag(['GLOBAL']) and $user2->attachTag(['GLOBAL']) does not create 2 tags named 'GLOBAL'. Works fine when attaching with a type as well.
Note: Note: Tag::findOrCreate() does the needful. So, should be continue to have Create()?
Beta Was this translation helpful? Give feedback.
All reactions