Pharaonic
Loading...
Taggable

# Why Taggable?

Taggable is a package provides an easy way to manage the model tags in Laravel.

# Installation

Install the latest version using Composer.

1composer require pharaonic/laravel-taggable
2php artisan migrate

# Tag Creation

This is how you can create a new multilingual tag.

This package depends on Translatable.

1use Pharaonic\Laravel\Taggable\Models\Tag;
2 
3$tag = Tag::create();
4$tag->translateOrNew('en')->name = 'First Tag';
5$tag->save();

# Inclusion

This is what you should to include in your model file.

1namespace App\Models;
2 
3use Illuminate\Database\Eloquent\Model;
4use Pharaonic\Laravel\Taggable\Traits\Taggable;
5 
6class Article extends Model
7{
8 use Taggable;
9 
10 protected $fillable = ['title'];
11}