PHPackages                             rtconner/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. rtconner/laravel-tagging

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

rtconner/laravel-tagging
========================

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

6.0.0(3mo ago)9123.1M↓78.8%16615MITPHPPHP ^8.2CI passing

Since Mar 7Pushed 3mo ago27 watchersCompare

[ Source](https://github.com/rtconner/laravel-tagging)[ Packagist](https://packagist.org/packages/rtconner/laravel-tagging)[ Docs](https://smartersoftware.net/packages/laravel-tagging-taggable)[ RSS](/packages/rtconner-laravel-tagging/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (6)Versions (50)Used By (15)

Laravel Taggable Trait
======================

[](#laravel-taggable-trait)

[![Tests](https://github.com/rtconner/laravel-tagging/actions/workflows/tests.yml/badge.svg)](https://github.com/rtconner/laravel-tagging/actions/workflows/tests.yml)[![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)

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()

```
composer require rtconner/laravel-tagging
```

#### 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.

#### Developer

[](#developer)

- Robert Conner -
- BlueSky -

###  Health Score

73

—

ExcellentBetter than 100% of packages

Maintenance79

Regular maintenance activity

Popularity66

Solid adoption and visibility

Community43

Growing community involvement

Maturity89

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 84.3% 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 ~99 days

Recently: every ~356 days

Total

45

Last Release

108d ago

Major Versions

0.5.4 → 2.0.82016-02-07

2.2.3 → 3.0.02018-08-13

3.2.3 → 4.0.02020-03-02

4.1.4 → 5.0.02024-12-21

5.0.1 → 6.0.02026-02-22

PHP version history (10 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

4.0.0PHP &gt;=7.0

4.1.0PHP ^7.3

4.1.1PHP ^7.3|^8.0

6.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/76a5f0095962be487b459678ea0ddb79ccbaf0e13a72c6ca50de0898e252275d?d=identicon)[rtconner](/maintainers/rtconner)

---

Top Contributors

[![rtconner](https://avatars.githubusercontent.com/u/334533?v=4)](https://github.com/rtconner "rtconner (264 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)")[![Xoshbin](https://avatars.githubusercontent.com/u/1606070?v=4)](https://github.com/Xoshbin "Xoshbin (3 commits)")[![vkbansal](https://avatars.githubusercontent.com/u/5930351?v=4)](https://github.com/vkbansal "vkbansal (2 commits)")[![marcusmoore](https://avatars.githubusercontent.com/u/1141514?v=4)](https://github.com/marcusmoore "marcusmoore (2 commits)")[![Firtzberg](https://avatars.githubusercontent.com/u/8490119?v=4)](https://github.com/Firtzberg "Firtzberg (2 commits)")[![computeus](https://avatars.githubusercontent.com/u/388505?v=4)](https://github.com/computeus "computeus (2 commits)")[![Uibar](https://avatars.githubusercontent.com/u/120263812?v=4)](https://github.com/Uibar "Uibar (2 commits)")[![nickfls](https://avatars.githubusercontent.com/u/12013206?v=4)](https://github.com/nickfls "nickfls (1 commits)")[![nicolasbinet](https://avatars.githubusercontent.com/u/867710?v=4)](https://github.com/nicolasbinet "nicolasbinet (1 commits)")[![remcom](https://avatars.githubusercontent.com/u/3468852?v=4)](https://github.com/remcom "remcom (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)")[![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

laraveleloquenttagstagtaggingtaggedTaggablelaravel-tag

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k29.9M42](/packages/kirschbaum-development-eloquent-power-joins)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

573714.4k4](/packages/cviebrock-eloquent-taggable)[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M16](/packages/reedware-laravel-relation-joins)

PHPackages © 2026

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