Skip to content
Laravel Packagev13.xMIT License1+ downloadsAI Ready · Laravel Boost

Tags: One tag per name, whatever the spelling

Tags tags any Eloquent model with typed tags whose names are normalized, aliased and translated, so "Laravel", " LARAVEL " and an alias like "L5" all land on the same tag. The database keeps each name to one tag, even when requests race. It is AI ready: php artisan boost:install teaches your coding agent the whole package through Laravel Boost.

$composer require pharaonic/laravel-tags

Compatibility

Each line is released for the versions in its row, read from that release's composer.json. Pick the line that matches your project; a combination not listed isn't supported. Find the right line of every package for your project.

LineLatest releasePHPLaravelStatusDocs
v13.xv13.0.0 Dec 6, 20268.3 – 8.613Current Docs: Read the v13.x docs
v12.xv12.0.0 Dec 6, 20268.2 – 8.512Maintained Docs: Read the v12.x docs
v11.xv11.0.0 Dec 6, 20268.2 – 8.411MaintainedLaravel 11 no longer gets security fixes Docs: Read the v11.x docs
v10.xv10.0.0 Dec 6, 20268.1 – 8.310MaintainedLaravel 10 no longer gets security fixes Docs: Read the v10.x docs
v9.xv9.0.0 Dec 6, 20268.0 – 8.29MaintainedLaravel 9 no longer gets security fixes Docs: Read the v9.x docs
v8.xv8.0.0 Dec 6, 20268.0 – 8.18MaintainedLaravel 8 no longer gets security fixes Docs: Read the v8.x docs
v7.xv7.0.0 Dec 6, 20268.07MaintainedLaravel 7 no longer gets security fixes Docs: Read the v7.x docs
v6.xv6.0.0 Dec 6, 20268.06MaintainedLaravel 6 no longer gets security fixes Docs: Read the v6.x docs

Maintenance

Latest release
v13.0.0
Dec 6, 2026 (8 hours ago)
Released lines
8
documented lines with a release; see compatibility
CI on develop
Tests passed
latest run Dec 6, 2026

From the package's releases and its GitHub Actions. A passing run means the test suite passed on develop, on every PHP version it supports; it isn't a security review, and each release line has its own runs on GitHub. Checked hourly.

A quick look

Tag a post, resolve an alias, and find related posts.

app/Http/Controllers/PostController.php
1$post->syncTags(['Laravel', 'PHP']);
2$post->attachTag('Laravel 11', 'version');
3 
4Tag::findOrCreate('JavaScript')->addAlias('JS');
5$post->attachTag('js'); // the JavaScript tag
6 
7$posts = Post::withAllTags(['laravel', 'php'])->latest()->paginate();
8$suggestions = Tag::suggest($request->query('q', ''), 5);
9$related = $post->relatedModels(Tag::ANY_TYPE, true)->limit(4)->get();
Key Features

Everything a tagging system needs

Add one trait to a model and tag it with names, models or keys.

Typed Tags

The same name in two types is two tags; reads and syncs can cover every type with Tag::ANY_TYPE.

Name Identity

Unicode normalization and case folding, aliases, renames and translated names all resolve to one tag.

Tag Policies

Attach existing tags only, globally or per model, by turning off automatic creation.

Search and Related

Search, suggestions, popular tags, related tags and related models with a similarity score.

Safe Under Load

Unique indexes, row locks and retried transactions keep tags correct when requests race.

AI Ready

Ships a Laravel Boost guideline and a tags-development skill, so php artisan boost:install teaches Claude Code, Cursor, Codex or Copilot the whole API.

FAQ

Tags Questions

Quick answers about installing and using Tags.

What is Tags?

Tag any Eloquent model with typed, normalized tags: one tag per name kept by a unique index, aliases and merges, tag policies, translations, search, suggestions and related models. It's a free, open-source Laravel package by Pharaonic.

How do I install Tags?

Run composer require pharaonic/laravel-tags in your project's root directory, then php artisan migrate.

What does Tags require?

The latest release requires PHP 8.3 – 8.6 and Laravel 13.

Can I move from spatie/laravel-tags or pharaonic/laravel-taggable?

Yes for the code: the Upgrade Guide maps the old methods to the new ones. The data is not imported: rename or drop the old tags and taggables tables before running the migrations.

Do I need Laravel Translatable?

No. Tags work without it. Install pharaonic/laravel-translatable only when tag names need translations; every translation then resolves to the tag.

Is Tags free to use?

Yes. Tags is open source under the MIT license, so you can use it in personal and commercial projects.

Where can I find the Tags documentation?

Read the Tags documentation for setup, configuration, and usage examples.

How do I report a bug or contribute to Tags?

Open an issue or a pull request on GitHub, ask in GitHub Discussions, or chat with us on Discord.

Ready to dig in?

Read the full documentation for installation, configuration, types and names, aliases and merging, policies, querying, search, translations, events, commands, and the migration guides from pharaonic/laravel-taggable and spatie/laravel-tags.