PHPackages                             polashmahmud/taggy - 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. polashmahmud/taggy

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

polashmahmud/taggy
==================

An Eloquent tagging package for laravel

v0.0.5(2y ago)581MITPHPPHP ^7.2.5|^8.0

Since Dec 8Pushed 2y ago1 watchersCompare

[ Source](https://github.com/polashmahmud/taggy)[ Packagist](https://packagist.org/packages/polashmahmud/taggy)[ RSS](/packages/polashmahmud-taggy/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

Taggy - Laravel Tagging Package
===============================

[](#taggy---laravel-tagging-package)

Taggy is a Laravel package that provides tagging functionality for your Eloquent models. Easily add and manage tags for your models with this simple and flexible package.

Features
--------

[](#features)

- **Tagging**: Associate tags with your Eloquent models.
- **Taggable Trait**: Easily make your models taggable using the Taggable trait.

Installation
------------

[](#installation)

To install Taggy, simply run:

```
composer require polashmahmud/taggy
```

Then, migrate your database:

```
php artisan migrate
```

Usage
-----

[](#usage)

### Tagging Models

[](#tagging-models)

To make a model taggable, use the `Polashmahmud\Taggy\Taggable` trait on the model:

```
use Polashmahmud\Taggy\Taggable;

class Post extends Model
{
    use Taggable;
}
```

### Creating Tags

[](#creating-tags)

To create a tag, use the `create()` method on the `Polashmahmud\Taggy\Models\Tag` model:

```
use Polashmahmud\Taggy\Models\Tag;

$tag = Tag::create([
    'name' => 'Laravel',
    'slug' => 'laravel',
]);
```

### Tagging Items

[](#tagging-items)

To tag an item, use the `tag()` method on the model, passing in the tag name or slug as a array:

```
$post = Post::find(1);

$post->tag(['Laravel']);
$post->tag(['Laravel', 'PHP']);
```

also you can pass tag:

```
$post = Post::find(1);
$tag = Tag::find(1);

$post->tag($tag);
```

### Untagging Items

[](#untagging-items)

To remove a tag from an item, use the `untag()` method on the model:

```
$post = Post::find(1);

$post->untag('Laravel');
$post->untag(['Laravel', 'PHP']);
```

Remove all tags from an item:

```
$post = Post::find(1);

$post->untag();
```

### Retagging Items

[](#retagging-items)

To remove all tags from an item and add new tags, use the `retag()` method on the model:

```
$post = Post::find(1);

$post->retag(['Laravel']);
$post->retag(['Laravel', 'PHP']);
```

### Tagging Scopes

[](#tagging-scopes)

Taggy provides a few useful query scopes for working with tags:

```
// Get all posts tagged with 'Laravel' and 'PHP'
$posts = Post::withAnyTag(['laravel', 'php'])->get();

// Get common tags for all posts
$posts = Post::withAllTags(['Laravel', 'PHP'])->get();

// GreaterThanEqual and LessThanEqual scopes
$tags = Tag::usedGreaterThanEqual(10)->get();
$tags = Tag::usedGreaterThen(10)->get();
$tags = Tag::usedLessThanEqual(10)->get();
$tags = Tag::usedLessThan(10)->get();
```

Contributing
------------

[](#contributing)

Thank you for considering contributing to Taggy! Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

Taggy is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

5

Last Release

886d ago

PHP version history (2 changes)v0.0.1PHP &gt;=7.4

v0.0.3PHP ^7.2.5|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/94d335e5718806f50e2afcdae4a21e749da7bff8aabd337932947860c8cf2c5a?d=identicon)[polashmahmud](/maintainers/polashmahmud)

---

Top Contributors

[![polashmahmud](https://avatars.githubusercontent.com/u/8996190?v=4)](https://github.com/polashmahmud "polashmahmud (8 commits)")

### Embed Badge

![Health badge](/badges/polashmahmud-taggy/health.svg)

```
[![Health](https://phpackages.com/badges/polashmahmud-taggy/health.svg)](https://phpackages.com/packages/polashmahmud-taggy)
```

###  Alternatives

[cybercog/laravel-love

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

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[genealabs/laravel-pivot-events

This package introduces new eloquent events for sync(), attach(), detach() or updateExistingPivot() methods on BelongsToMany relation.

1404.9M8](/packages/genealabs-laravel-pivot-events)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[aglipanci/laravel-eloquent-case

Adds CASE statement support to Laravel Query Builder.

115157.2k](/packages/aglipanci-laravel-eloquent-case)

PHPackages © 2026

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