codezero/laravel-unique-translation
Laravel validation rule for ensuring translated attribute values are unique per locale. Works with translatable models and JSON columns to prevent duplicate translations in forms, imports, and admin panels.
Rule object plus driver-specific JSON query logic plus an ignore-on-update path. That is roughly 1–3 engineering days and ongoing ownership. This is a composer require and a rule string. The decision is cheap to make and cheap to reverse.translations table. That's a real architectural fork — JSON columns simplify model code and querying for one locale, but they can't be enforced with a plain composite unique index. This package is the compensating control that makes the JSON approach defensible in a review.Adopt when all of the following hold:
spatie/laravel-translatable) and you are not migrating to a dedicated translations table.Look elsewhere when:
For executives: We can ship localized, SEO-friendly URLs and per-market product naming without a schema migration or a custom validation project. This is a small, MIT-licensed open-source component that closes a specific data-integrity gap — preventing two products or pages from claiming the same name or slug in the same language, which would otherwise surface as broken links and duplicate content in search. Cost is hours, not weeks, and there is no vendor lock-in; the code is small enough to absorb internally if needed. The tradeoff is that it is a low-profile dependency from a single maintainer, so we'll pin the version and treat it as a contained utility rather than a platform bet.
For engineering: It provides a unique_translation validation rule that queries inside a JSON translation column for a given locale and supports ignoring the current model on update, so edit forms don't false-positive. It slots into existing Form Requests and Spatie translatable models with no schema change. Two caveats to confirm before we commit: database driver support (MySQL/Postgres; check SQLite in tests) and that exact-match semantics are sufficient — if we need case-insensitive or accent-folded uniqueness, we normalize on write or wrap the rule. Given the maintenance profile, pin the version and note the fork path in the ADR.
How can I help you explore Laravel packages today?