spatie/nova-tags-field
Nova field for tagging resources using spatie/laravel-tags. Add the HasTags trait to your Eloquent models and use the Tags field in Nova to create, assign, and manage tags. Requires MySQL 5.7.8+ and installs via Composer.
spatie/laravel-tags under the hood, which provides a mature, battle-tested solution for tagging functionality (e.g., pivot tables, search, filtering). This aligns well with Laravel’s Eloquent ORM and database-first approach.spatie/laravel-tags is already installed.spatie/laravel-tags (v3.x+), which must be installed separately. This is a one-time dependency but adds slight complexity if not already in use.spatie/laravel-tags’s pivot-table approach. If your project uses a custom tagging system, migration effort may increase.spatie/laravel-tags already in use? If not, evaluate the effort to migrate existing tagging logic to this package.composer require spatie/nova-tags-field
composer require spatie/laravel-tags
php artisan vendor:publish --provider="Spatie\NovaTagsField\NovaTagsFieldServiceProvider"
use Spatie\NovaTagsField\NovaTagsField;
// In your Nova resource
public function fields(Request $request)
{
return [
NovaTagsField::make('Tags'),
// ... other fields
];
}
spatie/laravel-tags:
tags table or use the default pivot structure.whereHas('tags')) to ensure filtering works.Tag model (provided by spatie/laravel-tags). If your project uses a different naming convention, aliasing may be required.spatie/laravel-tags first, as it’s a dependency.spatie/laravel-tags is a separate package—ensure both are updated in sync to avoid compatibility issues.spatie/laravel-tags’s extensive docs. Expect a smooth onboarding for teams familiar with Nova.whereHas, which may need optimization for large datasets (e.g., adding indexes to pivot tables).spatie/laravel-tags migrations could break tag functionality. Always run migrations post-install.spatie/laravel-tags’s built-in deduplication.spatie/laravel-tags’s model setup.spatie/laravel-tags’s tag management (e.g., Tag::create(), model->tags()).How can I help you explore Laravel packages today?