PHPackages                             hkp22/laravel-taggable - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. hkp22/laravel-taggable

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hkp22/laravel-taggable
======================

Laravel model tagging package.

1.0(7y ago)014MITPHPPHP &gt;=5.5.0

Since Jul 4Pushed 7y agoCompare

[ Source](https://github.com/hkp22/laravel-taggable)[ Packagist](https://packagist.org/packages/hkp22/laravel-taggable)[ RSS](/packages/hkp22-laravel-taggable/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (5)Versions (3)Used By (0)

Laravel Taggable
================

[](#laravel-taggable)

Laravel Eloquent model tagging package.

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

[](#installation)

You can install the package via composer:

```
composer require hkp22/laravel-taggable
```

Usage
-----

[](#usage)

### Prepare Taggable model

[](#prepare-taggable-model)

```
use Hkp22\LaravelTaggable\Traits\Taggable;
use Illuminate\Database\Eloquent\Model as Eloquent;

class Lesson extends Eloquent
{
    use Taggable;
}
```

### Registering package

[](#registering-package)

Include the service provider within `app/config/app.php`:

```
'providers' => [
    Hkp22\LaravelTaggable\TaggableServiceProvider::class,
],
```

### Tag Eloquent model

[](#tag-eloquent-model)

Eg: Tagging a lesson Model.

```
$lesson->tag(['laravel', 'php']);
```

or

```
$tags = $tags = Tag::whereIn('slug', ['laravel', 'testing'])->get();

$lesson->tag($tags);
```

### Un-tag eloquent model

[](#un-tag-eloquent-model)

Eg: Un-tagging lesson model.

```
// Un-tag single tag.
$lesson->untag(['laravel']);

// Un-tag all tags.
$lesson->untag();
```

### Re-tag eloquent model

[](#re-tag-eloquent-model)

```
// Tag
$lesson->tag(['laravel', 'testing']);

// Re-tag
$lesson->retag(['laravel', 'postgres', 'redis']);
```

### Total tagged entities count.

[](#total-tagged-entities-count)

```
$tag = Tag::first();

$tag->count;
```

### Get model with any given tag

[](#get-model-with-any-given-tag)

```
$lessons = Lesson::withAnyTag(['php'])->get();
```

### Get model with only given tag

[](#get-model-with-only-given-tag)

```
$lessons = Lesson::withAllTags(['php', 'laravel', 'testing'])->get();
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

2869d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/409368752f65ba14c0c6bfaabf70353b13096503e1de1e13d3e6aa3899cb13aa?d=identicon)[hkp22](/maintainers/hkp22)

---

Top Contributors

[![hkp22](https://avatars.githubusercontent.com/u/39181262?v=4)](https://github.com/hkp22 "hkp22 (28 commits)")

---

Tags

laravel5tagging

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hkp22-laravel-taggable/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[kirschbaum-development/commentions

A package to allow you to create comments, tag users and more

12369.2k](/packages/kirschbaum-development-commentions)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[glhd/special

1929.4k](/packages/glhd-special)[bjuppa/laravel-blog

Add blog functionality to your Laravel project

483.3k2](/packages/bjuppa-laravel-blog)

PHPackages © 2026

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