A library that helps you build tags functionality around your existing models in the CodeIgniter 4 framework.
composer require michalsn/codeigniter-tags
Migrate your database:
php spark migrate --all
Add HasTags trait to your model and initialize tags with initTags() method.
class ExampleModel extends BaseModel
{
use HasTags;
// ...
protected function initialize()
{
$this->initTags();
}
// ...
}And if you use Entity class, add TaggableEntity trait to it:
class Example extends Entity
{
use TaggableEntity;
// ...
}https://michalsn.github.io/codeigniter-tags/