oleaass / laravel-tags
Add tags to any Laravel project
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:laravel-package
Requires
This package is auto-updated.
Last update: 2024-04-20 05:25:12 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; }