PHPackages                             filament/spatie-laravel-tags-plugin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. filament/spatie-laravel-tags-plugin

ActiveLibrary[Admin Panels](/categories/admin)

filament/spatie-laravel-tags-plugin
===================================

Filament support for `spatie/laravel-tags`.

v5.6.7(1mo ago)381.8M↓22.4%1120MITPHPPHP ^8.2

Since Aug 29Pushed 1w ago2 watchersCompare

[ Source](https://github.com/filamentphp/spatie-laravel-tags-plugin)[ Packagist](https://packagist.org/packages/filament/spatie-laravel-tags-plugin)[ Docs](https://github.com/filamentphp/filament)[ RSS](/packages/filament-spatie-laravel-tags-plugin/feed)WikiDiscussions 5.x Synced 3d ago

READMEChangelogDependencies (10)Versions (1192)Used By (20)

Filament Spatie Tags Plugin
===========================

[](#filament-spatie-tags-plugin)

Installation
------------

[](#installation)

Install the plugin with Composer:

```
composer require filament/spatie-laravel-tags-plugin:"^5.0" -W
```

If you haven't already done so, you need to publish the migration to create the tags table:

```
php artisan vendor:publish --provider="Spatie\Tags\TagsServiceProvider" --tag="tags-migrations"
```

Run the migrations:

```
php artisan migrate
```

You must also [prepare your Eloquent model](https://spatie.be/docs/laravel-tags/basic-usage/using-tags) for attaching tags.

> For more information, check out [Spatie's documentation](https://spatie.be/docs/laravel-tags).

Form component
--------------

[](#form-component)

This guide assumes that you've already set up your model to attach tags as per [Spatie's documentation](https://spatie.be/docs/laravel-tags/basic-usage/using-tags).

You may use the field in the same way as the [original tags input](https://filamentphp.com/docs/forms/tags-input) field:

```
use Filament\Forms\Components\SpatieTagsInput;

SpatieTagsInput::make('tags')
```

Optionally, you may pass a [`type()`](https://spatie.be/docs/laravel-tags/advanced-usage/using-types) that allows you to group tags into collections:

```
use Filament\Forms\Components\SpatieTagsInput;

SpatieTagsInput::make('tags')
    ->type('categories')
```

The tags input supports all the customization options of the [original tags input component](https://filamentphp.com/docs/forms/tags-input).

### Security: tag types and privilege namespaces

[](#security-tag-types-and-privilege-namespaces)

When you do not pass `->type(...)` to a `SpatieTagsInput`, the field matches and attaches tags across **every** type in your database. Internally, it calls `Tag::findFromStringOfAnyType($name)`, which returns the first existing tag matching by name — regardless of its `type`. This is convenient for general-purpose tagging, but it has a security implication if you also use tag types as a **privilege namespace**.

For example, suppose your application stores roles as tags:

```
$user->attachTag('admin', type: 'role');

// Later, in an authorisation check:
if ($user->hasTag('admin', 'role')) {
    // ...
}
```

If you then render a tags input on the same model without specifying a type — for example, a "Hobbies" field on the user's own profile — a low-privilege user can submit `admin` into that field. The save callback finds the existing `role:admin` tag (because it matches the name across all types), attaches it to the user, and the authorisation check now returns `true`. Autocomplete suggestions from `getSuggestions()` will also list every tag name in the database when no type is set, so the privileged tag names are visible to the attacker.

To prevent this, do at least one of the following:

- **Always pass `->type(...)` on user-facing tag inputs.** Restricting the input to a specific type means the save callback uses `syncTagsWithType()` instead of `syncTagsWithAnyType()`, so tags of other types can never be attached:

    ```
    SpatieTagsInput::make('hobbies')
        ->type('hobbies')
    ```

    If you have no need for tag types at all but want the safe scoping, pass `->type(null)`. The field will then read and write only untyped tags (`type IS NULL`):

    ```
    SpatieTagsInput::make('tags')
        ->type(null)
    ```
- **Do not use Spatie tag types as a privilege namespace** if you also expose a user-editable `SpatieTagsInput` on the same model. Store roles and permissions in a dedicated table (e.g. `spatie/laravel-permission`), or in a separate, never-user-editable model relationship.
- **Authorise the field itself** with `->disabled()` or `->hidden()` when the user lacks permission to manage tags on the record, paired with a server-side authorisation check.

The same caveat applies to `SpatieTagsColumn` (editable inline) — pass `->type(...)` when the column should be scoped to a single tag type.

Table column
------------

[](#table-column)

This guide assumes that you've already set up your model attach tags as per [Spatie's documentation](https://spatie.be/docs/laravel-tags/basic-usage/using-tags).

To use the tags column:

```
use Filament\Tables\Columns\SpatieTagsColumn;

SpatieTagsColumn::make('tags')
```

Optionally, you may pass a `type()`:

```
use Filament\Tables\Columns\SpatieTagsColumn;

SpatieTagsColumn::make('tags')
    ->type('categories')
```

The [type](https://spatie.be/docs/laravel-tags/advanced-usage/using-types) allows you to group tags into collections.

The tags column supports all the customization options of the [original tags column](https://filamentphp.com/docs/tables/columns/tags).

Infolist entry
--------------

[](#infolist-entry)

This guide assumes that you've already set up your model attach tags as per [Spatie's documentation](https://spatie.be/docs/laravel-tags/basic-usage/using-tags).

To use the tags entry:

```
use Filament\Infolists\Components\SpatieTagsEntry;

SpatieTagsEntry::make('tags')
```

Optionally, you may pass a `type()`:

```
use Filament\Infolists\Components\SpatieTagsEntry;

SpatieTagsEntry::make('tags')
    ->type('categories')
```

The [type](https://spatie.be/docs/laravel-tags/advanced-usage/using-types) allows you to group tags into collections.

The tags entry supports all the customization options of the [text entry](https://filamentphp.com/docs/infolists/entries/text).

###  Health Score

68

—

FairBetter than 99% of packages

Maintenance95

Actively maintained with recent releases

Popularity53

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

1191

Last Release

22d ago

Major Versions

v4.2.4 → v5.0.0-beta52025-11-28

v4.8.2 → v5.1.02025-12-09

v4.11.3 → v5.6.32026-05-11

v4.11.4 → v5.6.42026-05-20

4.x-dev → v5.6.62026-05-22

PHP version history (3 changes)v2.0.0-beta2PHP ^8.0

v3.0.0-alpha99PHP ^8.1

v4.0.0-alpha4PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/d5513b5defa6f680b8db229a305abf62d4e70f3e943b0da57dd5b303095c50c6?d=identicon)[DanHarrin](/maintainers/DanHarrin)

---

Top Contributors

[![danharrin](https://avatars.githubusercontent.com/u/41773797?v=4)](https://github.com/danharrin "danharrin (100 commits)")

### Embed Badge

![Health badge](/badges/filament-spatie-laravel-tags-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/filament-spatie-laravel-tags-plugin/health.svg)](https://phpackages.com/packages/filament-spatie-laravel-tags-plugin)
```

###  Alternatives

[filament/filament

A collection of full-stack components for accelerated Laravel app development.

3829.6M3.7k](/packages/filament-filament)[filament/spatie-laravel-media-library-plugin

Filament support for `spatie/laravel-medialibrary`.

1806.0M195](/packages/filament-spatie-laravel-media-library-plugin)[filament/forms

Easily add beautiful forms to any Livewire component.

4831.0M418](/packages/filament-forms)[filament/tables

Easily add beautiful tables to any Livewire component.

3730.5M156](/packages/filament-tables)[filament/infolists

Easily add beautiful read-only infolists to any Livewire component.

1327.7M65](/packages/filament-infolists)[filament/notifications

Easily add beautiful notifications to any Livewire app.

2530.8M86](/packages/filament-notifications)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
