oleaass / laravel-tags
Add tags to any Laravel project
v1.0.0
2021-04-26 12:03 UTC
Requires
This package is auto-updated.
Last update: 2026-03-20 09:40:09 UTC
README
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]);
Installation
$ composer require oleaass/laravel-tags
$ php artisan migrate # This will create two new database tables 'tags' & 'taggables'
Add tags to your Eloquent model
namespace App\Models; use OleAass\Tags\Taggable; class Post extends Model { use Taggable; }