arnehendriksen/laravel-tags

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

1.0.0 2020-01-27 12:11 UTC

This package is auto-updated.

Last update: 2020-10-19 21:12:48 UTC


README

Latest Version on Packagist Total Downloads

This package offers taggable behaviour for your models. After the package is installed the only thing you have to do is add the Taggable trait to an Eloquent model to make it taggable.

Installation

You can install the package via composer:

composer require arnehendriksen/laravel-tags

The package will automatically register itself.

Migrations will be loaded from the package service provider. The only thing you'll have to do is run them with:

php artisan migrate

Usage

// Attaching tags
$post->attachTag('marketing');
$post->attachTags(['seo','ranking']);

// Detaching tags
$post->detachTag('marketing');
$post->detachTags(['seo','ranking']);