PHPackages                             softtechnoes/laravel-tagging - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. softtechnoes/laravel-tagging

ActiveLibrary[Database &amp; ORM](/categories/database)

softtechnoes/laravel-tagging
============================

Use PHP traits to extend Laravel Eloquent Models to allow colorful Tags. Models can be marked as Taggable.

3.2.3(6y ago)027MITPHPPHP &gt;= 7.0

Since Mar 7Pushed 6y agoCompare

[ Source](https://github.com/softtechnoes/laravel-tagging)[ Packagist](https://packagist.org/packages/softtechnoes/laravel-tagging)[ Docs](https://smartersoftware.net/packages/laravel-tagging-taggable)[ RSS](/packages/softtechnoes-laravel-tagging/feed)WikiDiscussions laravel-6 Synced yesterday

READMEChangelogDependencies (6)Versions (37)Used By (0)

Laravel Taggable Trait | Colorful Tags
======================================

[](#laravel-taggable-trait--colorful-tags)

[![Latest Stable Version](https://camo.githubusercontent.com/a95d026344e0e235c66441d7b564eb2a7ed3c106ecc22c49091342e2c44f0e06/68747470733a2f2f706f7365722e707567782e6f72672f7274636f6e6e65722f6c61726176656c2d74616767696e672f762f737461626c652e737667)](https://packagist.org/packages/rtconner/laravel-tagging)[![Total Downloads](https://camo.githubusercontent.com/05fd09fdc43114a1ace5220f04231a2cd32fec473fe73ad8c036b5a75b868c4e/68747470733a2f2f706f7365722e707567782e6f72672f7274636f6e6e65722f6c61726176656c2d74616767696e672f646f776e6c6f6164732e737667)](https://packagist.org/packages/rtconner/laravel-tagging)[![License](https://camo.githubusercontent.com/f85fe25813ded52569ad3a3980063f4eb6fcbd8cc600e94118af29ad569f391c/68747470733a2f2f706f7365722e707567782e6f72672f7274636f6e6e65722f6c61726176656c2d74616767696e672f6c6963656e73652e737667)](https://packagist.org/packages/rtconner/laravel-tagging)[![Build Status](https://camo.githubusercontent.com/d263bef6dba89b3107535e9b32c0bd752cb61a8e65e6c9d62e2163e128d8f732/68747470733a2f2f7472617669732d63692e6f72672f7274636f6e6e65722f6c61726176656c2d74616767696e672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/rtconner/laravel-tagging)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/6efcfb2934952fa279d7ad90e04f9a6f477c761efd5f0e7add1650fc4e4df65e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7274636f6e6e65722f6c61726176656c2d74616767696e672f6261646765732f7175616c6974792d73636f72652e706e673f623d6c61726176656c2d35)](https://scrutinizer-ci.com/g/rtconner/laravel-tagging/?branch=laravel-5)

This package is not meant to handle javascript or html in any way. This package handles database storage and read/writes only.

There are no real limits on what characters can be used in a tag. It uses a slug transform to determine if two tags are identical ("sugar-free" and "Sugar Free" would be treated as the same tag). Tag display names are run through Str::title()

[Laravel/Lumen 5 Documentation](https://github.com/rtconner/laravel-tagging/tree/laravel-5)[Laravel 4 Documentation](https://github.com/rtconner/laravel-tagging/tree/laravel-4)

#### Composer Install (for Laravel 5+/Lumen 5)

[](#composer-install-for-laravel-5lumen-5)

```
composer require softtechnoes/laravel-tagging "~3.2"
```

#### Install and then Run the migrations

[](#install-and-then-run-the-migrations)

The package should auto-discover when you composer update. Then publish the tagging.php and run the database migrations with these commands.

```
php artisan vendor:publish --provider="Conner\Tagging\Providers\TaggingServiceProvider"
php artisan migrate
```

#### Setup your models

[](#setup-your-models)

```
class Article extends \Illuminate\Database\Eloquent\Model
{
	use \Conner\Tagging\Taggable;
}
```

#### Quick Sample Usage

[](#quick-sample-usage)

```
$article = Article::with('tagged')->first(); // eager load

foreach($article->tags as $tag) {
	echo $tag->name . ' with url slug of ' . $tag->slug;
}

$article->tag('Gardening'); // attach the tag

$article->untag('Cooking'); // remove Cooking tag
$article->untag(); // remove all tags

$article->retag(array('Fruit', 'Fish')); // delete current tags and save new tags

$article->tagNames(); // get array of related tag names

Article::withAnyTag(['Gardening','Cooking'])->get(); // fetch articles with any tag listed

Article::withAllTags(['Gardening', 'Cooking'])->get(); // only fetch articles with all the tags

Article::withoutTags(['Gardening', 'Cooking'])->get(); // only fetch articles without all tags listed

Conner\Tagging\Model\Tag::where('count', '>', 2)->get(); // return all tags used more than twice

Article::existingTags(); // return collection of all existing tags on any articles
```

[Documentation: More Usage Examples](docs/usage-examples.md)

[Documentation: Tag Groups](docs/tag-groups.md)

[Documentation: Tagging Events](docs/events.md)

[Documentation: Tag Suggesting](docs/suggesting.md)

### Configure

[](#configure)

[See config/tagging.php](config/tagging.php) for configuration options.

###### Lumen Installation

[](#lumen-installation)

[Documentation: Lumen](docs/lumen.md)

#### Upgrading Laravel 4 to 5

[](#upgrading-laravel-4-to-5)

This library stores full model class names into the database. When you upgrade laravel and you add namespaces to your models, you will need to update the records stored in the database. Alternatively you can override Model::$morphClass on your model class to match the string stored in the database.

#### Credits

[](#credits)

- Robert Conner -

#### Further Reading

[](#further-reading)

- [Laravel News article on tagging with this library](https://laravel-news.com/how-to-add-tagging-to-your-laravel-app)
- [3rd Party Posting on installation with Twitter Bootstrap 2.3](http://blog.stickyrice.net/archives/2015/laravel-tagging-bootstrap-tags-input-rtconner)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 82.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~60 days

Recently: every ~36 days

Total

34

Last Release

2466d ago

Major Versions

0.5.2 → 1.0.72015-05-29

1.1.3 → 2.0.02015-09-06

0.5.4 → 2.0.82016-02-07

2.2.3 → 3.0.02018-08-13

PHP version history (6 changes)0.1.0PHP &gt;=5.4.0

0.2.2PHP &gt;=5.3.0

0.5.1PHP ~5.3

2.0.0PHP &gt;=5.5.0

0.5.4PHP ~5.3|~7.0

3.1.0PHP &gt;= 7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/95523d5a254e557b55e70092b3b5121c0d00b9037b37c317ab7e15145042d925?d=identicon)[softtechnoes](/maintainers/softtechnoes)

---

Top Contributors

[![rtconner](https://avatars.githubusercontent.com/u/334533?v=4)](https://github.com/rtconner "rtconner (230 commits)")[![oschettler](https://avatars.githubusercontent.com/u/124634?v=4)](https://github.com/oschettler "oschettler (6 commits)")[![jakejohns](https://avatars.githubusercontent.com/u/174708?v=4)](https://github.com/jakejohns "jakejohns (5 commits)")[![jbardnz](https://avatars.githubusercontent.com/u/1628446?v=4)](https://github.com/jbardnz "jbardnz (3 commits)")[![epic-kaso](https://avatars.githubusercontent.com/u/5386122?v=4)](https://github.com/epic-kaso "epic-kaso (3 commits)")[![computeus](https://avatars.githubusercontent.com/u/388505?v=4)](https://github.com/computeus "computeus (2 commits)")[![vkbansal](https://avatars.githubusercontent.com/u/5930351?v=4)](https://github.com/vkbansal "vkbansal (2 commits)")[![Firtzberg](https://avatars.githubusercontent.com/u/8490119?v=4)](https://github.com/Firtzberg "Firtzberg (2 commits)")[![marcusmoore](https://avatars.githubusercontent.com/u/1141514?v=4)](https://github.com/marcusmoore "marcusmoore (2 commits)")[![softtechnoes](https://avatars.githubusercontent.com/u/37590945?v=4)](https://github.com/softtechnoes "softtechnoes (2 commits)")[![Uibar](https://avatars.githubusercontent.com/u/120263812?v=4)](https://github.com/Uibar "Uibar (2 commits)")[![mcmains](https://avatars.githubusercontent.com/u/1958721?v=4)](https://github.com/mcmains "mcmains (1 commits)")[![nicolasbinet](https://avatars.githubusercontent.com/u/867710?v=4)](https://github.com/nicolasbinet "nicolasbinet (1 commits)")[![stueynet](https://avatars.githubusercontent.com/u/1100677?v=4)](https://github.com/stueynet "stueynet (1 commits)")[![vinicius73](https://avatars.githubusercontent.com/u/1561347?v=4)](https://github.com/vinicius73 "vinicius73 (1 commits)")[![vtluan36](https://avatars.githubusercontent.com/u/6467862?v=4)](https://github.com/vtluan36 "vtluan36 (1 commits)")[![Woutrrr](https://avatars.githubusercontent.com/u/2762537?v=4)](https://github.com/Woutrrr "Woutrrr (1 commits)")[![Xoshbin](https://avatars.githubusercontent.com/u/1606070?v=4)](https://github.com/Xoshbin "Xoshbin (1 commits)")[![0plus1](https://avatars.githubusercontent.com/u/420815?v=4)](https://github.com/0plus1 "0plus1 (1 commits)")[![yamenarahman](https://avatars.githubusercontent.com/u/24607365?v=4)](https://github.com/yamenarahman "yamenarahman (1 commits)")

---

Tags

laraveleloquentlaravel5tagstagtaggingtaggedTaggable

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/softtechnoes-laravel-tagging/health.svg)

```
[![Health](https://phpackages.com/badges/softtechnoes-laravel-tagging/health.svg)](https://phpackages.com/packages/softtechnoes-laravel-tagging)
```

###  Alternatives

[rtconner/laravel-tagging

Use PHP traits to extend Laravel Eloquent Models to allow Tags. Models can be marked as Taggable.

8833.1M14](/packages/rtconner-laravel-tagging)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[rtconner/laravel-likeable

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

394388.0k5](/packages/rtconner-laravel-likeable)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[toponepercent/baum

Baum is an implementation of the Nested Set pattern for Eloquent models.

3154.7k](/packages/toponepercent-baum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
