PHPackages                             lecturize/laravel-tags - 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. lecturize/laravel-tags

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

lecturize/laravel-tags
======================

Simple way to tag Eloquent models in Laravel.

v1.1.0(3y ago)72.9k3MITPHPPHP ^8.0

Since Sep 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Lecturize/Laravel-Tags)[ Packagist](https://packagist.org/packages/lecturize/laravel-tags)[ Docs](https://github.com/Lecturize/Laravel-Tags)[ RSS](/packages/lecturize-laravel-tags/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (7)Versions (7)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/72c3c8a8533da2b9ba33d56c53537ca73cf75823645bc251128726be1de88f30/68747470733a2f2f706f7365722e707567782e6f72672f6c6563747572697a652f6c61726176656c2d746167732f762f737461626c65)](https://packagist.org/packages/lecturize/laravel-tags)[![Total Downloads](https://camo.githubusercontent.com/50ff08dea0662e54acf2f6cd45c366fb0fe2d17b46190565d6b99f2c0bb63b9e/68747470733a2f2f706f7365722e707567782e6f72672f6c6563747572697a652f6c61726176656c2d746167732f646f776e6c6f616473)](https://packagist.org/packages/lecturize/laravel-tags)[![License](https://camo.githubusercontent.com/ed4b3784811c4bc240d73a2084e4ccc6e919d63cada4a4b78662f74fa0eda85a/68747470733a2f2f706f7365722e707567782e6f72672f6c6563747572697a652f6c61726176656c2d746167732f6c6963656e7365)](https://packagist.org/packages/lecturize/laravel-tags)

Laravel Tags
============

[](#laravel-tags)

Simple way to tag eloquent models in Laravel.

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

[](#installation)

Require the package from your `composer.json` file

```
"require": {
    "lecturize/laravel-tags": "^1.0"
}
```

and run `$ composer update` or both in one with `$ composer require lecturize/laravel-tags`.

Configuration &amp; Migration
-----------------------------

[](#configuration--migration)

```
$ php artisan vendor:publish --provider="Cviebrock\EloquentSluggable\ServiceProvider"
$ php artisan vendor:publish --provider="Lecturize\Tags\TagsServiceProvider"
```

This will publish a `config/sluggable.php`, a `config/lecturize.php` and some migration files, that you'll have to run:

```
$ php artisan migrate
```

For migrations to be properly published ensure that you have added the directory `database/migrations` to the classmap in your projects `composer.json`.

Usage
-----

[](#usage)

First, add our `HasTags` trait to your model.

```

```

##### Get all tags for a model

[](#get-all-tags-for-a-model)

```
$tags = $model->tags();
```

##### Check if model is tagged with a given tag

[](#check-if-model-is-tagged-with-a-given-tag)

```
$tags = $model->hasTag('Check');
```

##### Add one or more tags

[](#add-one-or-more-tags)

```
$tags = $model->tag('My First Tag');
$tags = $model->tag(['First', 'Second', 'Third']);
```

##### Remove given tags from model

[](#remove-given-tags-from-model)

```
$tags = $model->untag('Remove');
```

##### Replace all existing tags for a model with new ones

[](#replace-all-existing-tags-for-a-model-with-new-ones)

```
$tags = $model->retag('A New Tag');
$tags = $model->retag(['Fourth', 'Fifth', 'Sixth']);
```

##### Remove all existing tags from model

[](#remove-all-existing-tags-from-model)

```
$tags = $model->detag();
```

##### Get a list of all tags

[](#get-a-list-of-all-tags)

```
$tags = $model->listTags();
```

This is a convenience method for `$model->tags->pluck('tag')`

##### Scopes

[](#scopes)

There are two scopes included to fluently query models (e.g. Posts) with given tags.

```
$posts = Post::withTag('My First Tag')->get();
$posts = Post::withTags(['First', 'Second', 'Third'])->get();
```

License
-------

[](#license)

Licensed under [MIT license](http://opensource.org/licenses/MIT).

Author
------

[](#author)

**Handcrafted with love by [Alexander Manfred Poellmann](https://twitter.com/AMPoellmann) in Vienna &amp; Rome.**

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity72

Established project with proven stability

 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 ~545 days

Recently: every ~508 days

Total

6

Last Release

1179d ago

Major Versions

v0.1.1 → v1.0.02021-02-09

PHP version history (5 changes)v0.0.1PHP &gt;=5.5.9

v0.1.0PHP &gt;=5.6.4|^7.0

v0.1.1PHP &gt;=7.2

v1.0.0PHP ^7.2.5|^8.0

v1.1.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/d780bcb538e8dfa5311d2d1bd17bad79e8b9b36e4e9eb4db980ef33c3a22b366?d=identicon)[AlexanderPoellmann](/maintainers/AlexanderPoellmann)

---

Top Contributors

[![AlexanderPoellmann](https://avatars.githubusercontent.com/u/6631793?v=4)](https://github.com/AlexanderPoellmann "AlexanderPoellmann (78 commits)")

---

Tags

laravelmodeleloquenttagstaggingTaggable

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lecturize-laravel-tags/health.svg)

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

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[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)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

591444.8k2](/packages/spiritix-lada-cache)

PHPackages © 2026

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