gasner/tag-manager

There is no license information available for the latest version (dev-master) of this package.

tag manager model

dev-master 2020-06-30 20:43 UTC

README

This package helps you easily add tags to different records in different tables. Designed for Laravel framework only

Installation

You can add this library as a local, per-project dependency to your project using Composer:

composer require gasner/TagManager

Usage

<?php
use gasner\TagManager\App\TagAble;
use Illuminate\Foundation\Auth\User as Authenticatable;


class User extends Authenticatable
{
    use TagAble;
}
use App\User;
$user = User::find($id);
// Remove old tags and add the new tags'
$user->setTags(["active user","free user"]);
//Add new tags and Not remove oldest tags
$user->addTags(["free user","active user"]);