mujahidabbas/laravel-user-tags
Laravel User Tags lets you attach custom tags to user models, making it easy to categorize, filter, and segment users. It offers a simple API for adding, removing, and querying tags, so you can organize users with lightweight labels throughout your Laravel application.
HasUserTags is a trait applied per-model, small teams can ship tagging on one entity (e.g. "label your projects") and expand to others without schema migrations or a new service. This supports incremental rollout behind a flag.tags + taggables + user_id implementation where the scoping predicate is the easy thing to forget.Consider adoption when:
withAnyUserTags() / withAllUserTags() / withoutUserTags().Look elsewhere — or build in-house — when:
spatie/laravel-tags or a custom implementation.withAllUserTags() on large datasets; validate with your own data before committing. "All of these tags" queries are classically the slow one (multiple joins or HAVING COUNT patterns).Recommended diligence before adoption: read the migrations, confirm the unique constraint that enforces per-user tag identity, verify index coverage on (user_id, tag) and the pivot, and check the issue tracker for maintenance responsiveness.
For executives: This is a small, free, open-source Laravel component that gives us per-user tagging on any of our models without building it ourselves. It converts a multi-sprint "organize and label your stuff" feature into a few days of integration work, and its user-isolation design means one customer's tags are structurally separated from another's — a trust and compliance benefit. The trade-off is maturity: it's a v1.0.0 from a single maintainer, so we should plan to own a copy of the code rather than depend on it long-term. Low cost, low lock-in, moderate but manageable risk.
For engineering: A HasUserTags trait plus attachUserTag() / detachUserTag() / syncUserTags() and three query scopes (withAnyUserTags, withAllUserTags, withoutUserTags), supporting Laravel 10–12 and PHP 8.1–8.3. It replaces the pivot table, trait, and scoping logic we'd otherwise hand-roll — specifically the per-user scoping predicate, which is where homegrown implementations tend to leak. Before we adopt: review the migrations and pivot schema, confirm index coverage on the tag lookup and the "match all tags" path, and confirm the unique constraint. Plan to vendor the package into our repo so we control upgrades. If we later need shared tags, taxonomy management, or tag analytics, that's outside this package's scope and should be scoped as separate work.
Caveat on this assessment: it is based solely on the v1.0.0 release notes. Schema details, pivot design, cascade-delete behavior, and performance characteristics are unverified and should be confirmed against the README and source before a build-vs-buy commitment.
How can I help you explore Laravel packages today?