PHPackages                             andileong/taggi - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. andileong/taggi

ActiveLibrary[Framework](/categories/framework)

andileong/taggi
===============

The Laravel Framework.

1.2(4y ago)09PHPPHP &gt;=8.0

Since Jul 10Pushed 4y ago1 watchersCompare

[ Source](https://github.com/andiLeong/taggi)[ Packagist](https://packagist.org/packages/andileong/taggi)[ RSS](/packages/andileong-taggi/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

Taggi --- A laravel package to make your model tag easy
-------------------------------------------------------

[](#taggi-----a-laravel-package-to-make-your-model-tag-easy)

### Built with TTD, just a small adn simple package that make your taggable easy.

[](#built-with-ttd-just-a-small-adn-simple-package-that-make-your-taggable-easy)

### installtation

[](#installtation)

It required at least php8 isntalled on your machine

```
composer require andileong/taggi

```

**Config:**

You can pull config file to your own by doing:

```
php artisan vendor:publish --tag=taggi-config //pull in the config file

php artisan vendor:publish --tag=taggi-migrations //pull in the migration file

```

**Tag Creation:**

You can Create one Tag or massily create tag.

```
 // create one tag

$tag = new \Andileong\Taggi\Models\Tag()
$tag->put('tag name');

//creating multiple tags

$data = ['name1','name2','name3'];
$tag->massPut($data);

when we massive create tag you can pass a tring or array
I will pharse the string to a array for you
$data = ['name1','name2','name3'];
$data = "tag,tag2,tag3";
$data = "tag|tag2|tag3";

by default the string separator is supported as below
'separator' => "[,|!:.]",

you can overwrite it in the config file

CAUTION the tag model is use $guarded = [];
so be sure validate the data before insert.

more information check out:
https://laravel.com/docs/8.x/eloquent#mass-assignment

```

**Tag Relation:**

You can tag your model to tag to build up morph many to many

First of all, use my tag trait inside your model

```
