Downloads
Stars
Version
This package allows you to easily add tags to any Eloquent model you have in your Laravel application
$post = \App\Models\Post::create([
'title' => 'My first post'
]);
$tag = \OleAass\Tags\Models\Tag::create([
'name' => 'My tag'
]);
$post->tags()->attach([$tag->id]);
$ composer require oleaass/laravel-tags
$ php artisan migrate # This will create two new database tables 'tags' & 'taggables'
namespace App\Models;
use OleAass\Tags\Taggable;
class Post extends Model
{
use Taggable;
}