Weave Code
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

Laravel Tags Laravel Package

spatie/laravel-tags

Add flexible tagging to Laravel Eloquent models with the HasTags trait. Create, attach, detach, and query tags with ease, with built-in support for tag types, translations, and sorting—ideal for organizing content across your app.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature Development:

    • Enable tagging functionality for content models (e.g., articles, products, or user-generated content) to improve discoverability and categorization.
    • Support multi-lingual tagging for global applications, leveraging built-in translation features.
    • Implement tag-based filtering (e.g., "Show all posts with tags X, Y, or Z") to enhance user experience in search and discovery flows.
    • Add tag hierarchies or types (e.g., "categories" vs. "topics") to organize metadata flexibly.
  • Roadmap Prioritization:

    • Build vs. Buy: Justify adopting this package over custom development for tagging, reducing technical debt and accelerating feature delivery.
    • Scalability: Use the package’s sortable tags and type-based queries to support future growth in content volume or complexity.
    • Localization: Align with i18n roadmap by leveraging the package’s translation support for tags.
  • Use Cases:

    • Content Platforms: Tag articles, tutorials, or blog posts for SEO and user navigation.
    • E-commerce: Categorize products with tags (e.g., "sale," "new arrival," "organic") for dynamic filtering.
    • Community Forums: Allow users to tag discussions (e.g., "#bug," "#feature-request") for better organization.
    • Analytics Dashboards: Tag metrics or reports for ad-hoc grouping and visualization.

When to Consider This Package

  • Adopt This Package If:

    • Your Laravel app requires simple yet powerful tagging with minimal boilerplate (e.g., attaching/detaching tags via traits).
    • You need multi-type tags (e.g., categories, topics, or custom taxonomies) without complex custom logic.
    • Your team prioritizes developer velocity over fine-grained control (e.g., no need for custom pivot tables or tag logic).
    • You’re using Laravel 8+ and a MySQL/PostgreSQL database with JSON support.
    • Localization or tag sorting is a requirement (built-in features save dev time).
  • Look Elsewhere If:

    • You need advanced tag relationships (e.g., nested tags, weighted tags, or graph-based hierarchies) beyond simple types.
    • Your app requires real-time tag synchronization (e.g., WebSockets) or offline-first tagging (this package is server-side only).
    • You’re using SQLite or a database without JSON support (though PostgreSQL is now supported).
    • You need custom tag validation (e.g., regex patterns, blacklists) beyond basic string handling.
    • Your use case demands tag analytics (e.g., trending tags, co-occurrence) that aren’t natively supported.

How to Pitch It (Stakeholders)

For Executives:

"This package lets us add tagging to our [content/products/community] with zero custom development—saving 3–6 months of work. It supports multilingual tags, custom tag types (e.g., categories vs. topics), and advanced filtering (e.g., ‘show me everything tagged X or Y’), which directly improves [user engagement/SEO/conversion]. Since it’s MIT-licensed and maintained by Spatie (a trusted open-source vendor), we avoid vendor lock-in while reducing technical risk. The cost? Just a few hours to install and configure—far cheaper than building this in-house."

For Engineering:

*"Laravel-Tags gives us a batteries-included solution for tagging with:

  • Zero migrations: Just add the HasTags trait to any model.
  • Multi-type tags: Tag models with ‘categories,’ ‘topics,’ or custom types via attachTag(..., 'type').
  • Localization: Built-in translation support for tags (e.g., ‘#tag’ → ‘#étiquette’ in French).
  • Query scopes: Filter models by tags (e.g., Model::withAnyTags(['tag1', 'tag2'])) or tag types.
  • Sortable tags: Drag-and-drop ordering via spatie/eloquent-sortable integration.
  • PostgreSQL/MySQL support: Works with our existing DB stack.

Trade-offs:

  • No real-time sync (client-side updates would need additional logic).
  • Limited customization for edge cases (e.g., tag analytics).

Recommendation: Use this for core tagging needs; extend only if we hit limits (e.g., custom tag validation)."*

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.
codraw/framework-extra-bundle
codraw/messenger
codraw/security
codraw/mailer
codraw/contracts
codraw/profiling
codraw/dependency-injection
codraw/tester
codraw/core
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony