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

Technical Evaluation

Architecture fit: The package is built specifically for Laravel, leveraging Eloquent models, service container patterns, and standard Laravel conventions (traits, migrations, config). It integrates seamlessly with Laravel's existing ecosystem without requiring architectural overhauls. The use of JSON fields for translations and a dedicated taggables table follows Laravel's recommended patterns for flexible data relationships.

Integration feasibility: High. Installation is trivial via Composer, migrations are auto-published with a single command, and adding the HasTags trait to models requires minimal code changes. The documentation provides clear, copy-paste examples for all core operations (attaching/syncing tags, translations, types), reducing implementation complexity.

Technical risk: Low to moderate. Primary risks include:

  • Database compatibility issues if using older MySQL versions (<5.7.8) or non-JSON-supporting databases
  • Potential performance bottlenecks with very large tag datasets (>100k tags) due to JSON query operations
  • Dependency chain on spatie/laravel-translatable and spatie/eloquent-sortable which could introduce version conflicts

Key questions:

  • How does the package handle concurrent tag creation/updates under high-load scenarios (e.g., 1k+ requests/sec)?
  • What's the performance impact when querying tags with multiple translations across 1M+ records?
  • Are there known conflicts with other popular Laravel packages (e.g., scout for search, spatie/laravel-medialibrary)?

Integration Approach

Stack fit: Requires Laravel 8+ and PHP 8+, aligning with modern Laravel projects. Database must support JSON fields (MySQL 5.7.8+, PostgreSQL 9.4+, or SQLite 3.9+). Works with standard Laravel stack components (Eloquent, Query Builder, Artisan) without requiring specialized infrastructure.

Migration path: For new projects: trivial implementation. For existing projects:

  1. Existing tag data must be migrated to the new tags and taggables tables via custom scripts
  2. Models with existing tag fields need to be refactored to use the trait-based approach
  3. Custom tag logic should be replaced with package methods (e.g., attachTag() instead of manual pivot table operations)

Compatibility: Fully compatible with Laravel's ecosystem when using standard configurations. Potential conflicts may arise if:

  • Other packages use the same trait name (HasTags) or override Eloquent methods
  • Database collation settings conflict with JSON field requirements
  • Custom tag implementations exist in the codebase that duplicate package functionality

Sequencing:

  1. Install package via Composer
  2. Publish and run migrations (`php artisan vendor:publish --provider="Spatie\Tags\TagsServiceProvider" --tag
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport