michalsn/codeigniter-tags

Tags for CodeIgniter 4 framework

v1.1.1 2024-01-05 14:57 UTC

This package is auto-updated.

Last update: 2024-10-17 19:18:40 UTC


README

A library that helps you build tags functionality around your existing models in the CodeIgniter 4 framework.

PHPUnit PHPStan Deptrac Coverage Status

PHP CodeIgniter

Installation

composer require michalsn/codeigniter-tags

Migrate your database:

php spark migrate --all

Configuration

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;

    // ...
}

Docs

https://michalsn.github.io/codeigniter-tags/