arnehendriksen/laravel-tags

This package's canonical repository appears to be gone and the package has been frozen as a result.

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']);