- How do I install filament/spatie-laravel-tags-plugin in a Laravel app?
- Install it with Composer using the ^5.0 constraint and the -W flag, then publish Spatie's tags migration and run php artisan migrate. Add Spatie's HasTags trait to the target Eloquent model, then use SpatieTagsInput::make('tags') in a Filament resource form. There is no plugin service provider configuration or custom persistence layer to set up.
- Which Filament, Laravel, and PHP versions does this plugin support?
- The plugin's ^5.0 line tracks Filament v5, so it requires a Filament v5 panel and the PHP and Laravel versions that Filament v5 supports, including PHP 8.2 or later in the evaluated stack. It has no independent release cadence; upgrading Filament upgrades this plugin in lockstep. Pin Filament explicitly and treat the plugin version as part of that upgrade.
- How do I group tags into types with SpatieTagsInput?
- Pass ->type('categories') to SpatieTagsInput::make('tags') to group tags into a Spatie tag type. Without a type, the field matches and attaches tags across every type in the database. Ensure existing write paths use the same type, because mismatches can appear as tags silently not showing up.
- What are the security risks of leaving type() unset on SpatieTagsInput?
- Without type(), the field calls Tag::findFromStringOfAnyType and can attach the first existing tag matching by name regardless of type. If tag types act as privilege namespaces, a low-privilege user could submit a privileged tag name into an untyped field and attach it to their model. Always set type() on fields that should not cross type boundaries, especially when tags drive authorization.
- Is filament/spatie-laravel-tags-plugin a standalone package?
- It is a read-only subtree split of a component that ships inside filament/filament, not a standalone tagging library. The low star and dependent counts on this repository are artifacts of that packaging; real usage flows through Filament. Do not treat the split repository metrics as a separate adoption signal.
- How do I prepare my Eloquent model for SpatieTagsInput?
- Add Spatie's HasTags trait to the Eloquent model and make sure the tags and taggables tables exist by publishing and running Spatie's tags migration. The Filament field only adapts Spatie's persistence to Filament's form API; it does not create the schema for you. Follow Spatie's model preparation docs before adding SpatieTagsInput to a resource.
- Can I scope tags per tenant or customize the Spatie tags migration?
- Spatie's default tags schema is global, so per-tenant scoping requires a custom tag model and migration changes such as a tenant column. Publishing the vendor migration puts a Spatie-owned table in your migrations directory, and any indexes, UUID keys, or tenant columns become a fork you maintain. Scope this as a data-model change, not a package install.
- Is composer require -W safe when installing this plugin?
- The -W flag allows Composer to rewrite transitive dependencies, which in a mature app can silently move Laravel or Spatie versions. Run the install on an isolated branch and review the lockfile diff as its own commit. Never bundle it with feature work, and pin Filament explicitly.
- Does SpatieTagsInput support all the original Filament tags input customizations?
- Yes, SpatieTagsInput supports all the customization options of Filament's original tags input component and adds an optional type() method for Spatie tag groups. You can use the same field API and then chain type() when tags need a namespace. Leaving type() off is the main behavioral difference to watch.
- When should I avoid this plugin and model tagging myself?
- Avoid this plugin if tagging is a governed taxonomy you intend to model yourself, such as workflow states, hierarchical categories, or per-tenant taxonomies with custom authorization. It imposes Spatie's tags and taggables polymorphic schema, so a bespoke tagging implementation becomes a data migration project rather than a package install. For free-form labels inside a Filament v5 panel, it is a low-friction fit.