Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Tags For Laravel Laravel Package

roundly-consulting/tags-for-laravel

Add tags to any Eloquent model in Laravel. Attach, detach, and query tags through a simple, expressive API, with polymorphic relationships so posts, users, or any other model can be tagged and filtered with ease.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The package is a Laravel-native tagging component: polymorphic taggable relations, per-type tag namespaces, and a first-party popular-tags endpoint (GET tags/{type}/popular?on=). It leans on Eloquent global scopes for visibility semantics, which is the idiomatic Laravel multi-tenancy and soft-delete pattern. For a Laravel monolith or modular monolith already using Eloquent scopes for tenant isolation, this is a low-friction fit. For services that filter tenancy outside Eloquent (query builders, raw SQL, repository layers), the fit is weaker because the package's correctness guarantees are scope-dependent.

Integration feasibility. Drop-in via Composer, publishable migrations, and route registration. The on query parameter implies the caller passes the taggable model (or morph alias), so integration requires a configured morph map and consistent type naming. Effort is low-to-moderate; the main integration work is confirming that our tenant and soft-delete global scopes are actually registered on every model passed via on, and that the tags route sits behind the same auth/tenant middleware as the rest of the API.

Technical risk. Upgrade risk from 1.0.1 to 1.0.2 is low — patch release, no breaking changes, no deprecations, no API surface changes. However, the fix itself is risk-relevant: prior to 1.0.2, popular-tag counts ignored global scopes, meaning soft-deleted records and other tenants' records inflated counts. That is a cross-tenant metadata leak (counts reveal activity volume) and a correctness bug in usage analytics. Anyone shipping 1.0.0–1.0.1 should treat this as a security-adjacent correctness fix and enforce >=1.0.2. Residual risk is concentrated in caching: if tag counts are cached above the query layer, the fix will not propagate until caches are invalidated.

Key questions.

  • Which Laravel and PHP versions are supported, and is there a published support window / LTS policy?
  • Does the popular endpoint cache results? If so, what is the TTL and invalidation trigger, and does 1.0.2 invalidate stale scoped counts?
  • Is on a fully-qualified class name or morph alias, and does it validate against an allowlist? Unvalidated class resolution is a potential attack surface.
  • What middleware protects the routes by default, and can route registration be disabled for headless use?
  • Are there tests asserting scope behavior across tenant boundaries, or only soft deletes?
  • What is the release cadence and semantic versioning discipline (1.0.x suggests pre-1.1 stability)?
  • Does the count query scale (indexes on taggables, aggregate strategy), and is there a documented pagination/limit on popular results?

Integration Approach

Stack fit. Assumes Laravel 10/11 and PHP 8.1+. The package composes cleanly with standard Laravel auth, middleware groups, and Eloquent scoping. It does not appear to impose a tenancy implementation; it inherits whatever global scopes the host app defines. That is good for portability and bad for guarantee — correctness is contingent on our own scope discipline.

Migration path. Pin ^1.0.2 as the floor. Existing installs on 1.0.0/1.0.1 need a Composer update plus cache clears (php artisan cache:clear, and any tagged/CDN cache for the endpoint). No schema migration is implied by the release note; verify against the package changelog before assuming. If we maintain a fork or a vendored copy, cherry-pick the scoping change rather than the full release.

Compatibility. Backward compatible at the API contract level: same route, same parameters, same response shape. Behavior changes only for records excluded by global scopes — counts will drop for tenants with soft-deleted data, which downstream dashboards may notice as a step change. Confirm that no consumer depends on the previously inflated totals before rollout, and annotate the change in internal release notes as a metric discontinuity rather than a regression.

Sequencing.

  1. Verify scope coverage: enumerate every model passable via on and confirm tenant and soft-delete global scopes are registered.
  2. Upgrade to ^1.0.2 in a staging environment; clear caches.
  3. Write or run cross-tenant tests: create records under tenant A and B, soft-delete some, assert counts are isolated.
  4. Audit route exposure — auth middleware, rate limiting, and whether on is validated.
  5. Backfill/annotate analytics dashboards for the expected count drop.
  6. Roll to production behind normal canary; monitor endpoint latency and error rate.
  7. Add a regression test in our suite so a future downgrade or fork drift is caught.

Operational Impact

Maintenance. Low. Patch releases, single maintainer-style cadence typical of 1.0.x packages. The operational burden is mostly ours: keeping global-scope registration correct as models evolve, since the package's correctness is inherited rather than enforced. Budget a small recurring review each time a new taggable model is added.

Support. No commercial support implied. Dependency risk is moderate — a pre-1.1 package with a security-adjacent fix history should be tracked in our dependency register with an owner and a review date. If the package stalls, the fallback is straightforward: the tagging schema is simple enough to fork or reimplement against our own query layer.

Scaling. The popular-tags endpoint is an aggregate count over the taggables pivot, filtered by type and model. At scale this is the hot path: counts are expensive relative to list queries and are typically cached. Two concerns: (a) aggregate query cost grows with tag volume and pivot size, so confirm indexes on the pivot and consider a materialized/cached count table; (b) scoped counts vary per tenant, so any cache key must include tenant identity — a shared cache key is a cross-tenant leak vector and would re-create exactly the bug 1.0.2 fixes.

Failure modes.

  • Scope drift: a new model ships without tenant scope; counts silently include other tenants' data again. Mitigation: test coverage per model, and an allowlist for on.
  • Stale cache: fixed query, unfixed cache; counts remain inflated post-upgrade. Mitigation: explicit cache purge in the runbook.
  • Unvalidated on: arbitrary class resolution if the parameter is passed to the container or query builder unfiltered. Mitigation: middleware-level validation.
  • Metric discontinuity: dashboards show a step-down in tag popularity post-upgrade and get misread as an outage. Mitigation: pre-announce and annotate.
  • Downgrade/rollback: reverting to 1.0.1 reintroduces the leak. Mitigation: pin the floor in composer.json and treat rollback as a security decision, not a routine one.

Ramp-up. Low for a Laravel-fluent engineer — a day to integrate, half a day to validate scoping and routes. The non-obvious learning is the scope-inheritance model: engineers must understand that the package is only as tenant-safe as the global scopes we register, and that this release moved that contract from implicit to load-bearing. Document that in the integration README so it survives team turnover.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log