Closed jeremysalmon closed 1 year ago
Add isUsed() to check if a tag is used in database.
I use this method to check that a tag is unused and in this case delete it from the database.
For exemple when I click on the cross in livewire :
public function removeTag($tagName) { $tag = Tag::findFromString($tagName); $this->company->detachTag($tagName); $this->company->refresh(); if(!$tag->isUsed()) { $tag->delete(); } }
Thanks! I'm going to pass on this one, to keep the package light.
Add this in your own project.
Add isUsed() to check if a tag is used in database.
I use this method to check that a tag is unused and in this case delete it from the database.
For exemple when I click on the cross in livewire :