Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

translatable-development

Skill by spatie

Guides an AI assistant through working with spatie/laravel-translatable. It covers making Eloquent models translatable, storing translations as JSON, and reading, querying and testing them for Laravel developers.

  • Score 91
  • 2.5k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install translatable-development

Built from the published package, never by AI.

git clone --depth 1 https://github.com/spatie/laravel-translatable /tmp/laravel-translatable && mkdir -p ~/.claude/skills && cp -r /tmp/laravel-translatable/resources/boost/skills/translatable-development ~/.claude/skills/translatable-development

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install translatable-development in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill is a usage guide for spatie/laravel-translatable, a Laravel package. Translations are stored as JSON on the model itself, so no extra tables or pivots are needed. The guide shows how to declare translatable attributes with the #[Translatable] attribute or the $translatable property, and how to write the matching migration with json or text columns.

The skill also covers setting translations for the current or a specific locale, reading them with or without fallback, querying by locale, forgetting translations, configuring fallback behavior per model, and writing Pest-style tests. It lists common pitfalls, such as avoiding array or json casts on translatable columns. It is aimed at developers building multi-language Eloquent models in Laravel.

Written from the project's SKILL.md and checked against it.

What it can do

  • Make a model translatableDeclares translatable attributes with the #[Translatable] attribute or the $translatable property.
  • Write translatable migrationsShows json or text columns to hold all locales for each translatable attribute.
  • Set translationsSets values for the current locale, a specific locale, several locales, or via mass assignment.
  • Get translationsReads translations with or without fallback, for one attribute or all attributes.
  • Query by localeFilters models by whereLocale, whereLocales and whereJsonContainsLocale.
  • Forget translationsRemoves a locale from one attribute, all locales from one attribute, or one locale across all attributes.
  • Configure fallbackDisables fallback or sets a custom fallback locale on a model.
  • Test translatable behaviorProvides example Pest tests for storing and falling back translations.

What you need

  • A Laravel project using Eloquent models
  • The spatie/laravel-translatable package

Try asking

  • Make my NewsItem model translatable for name and description
  • Write a migration with json columns for translatable fields on the products table
  • Add a Dutch translation to this article and fall back to English if it is missing

Good to know

  • Translatable columns must be json or text, a string column will throw on JSON casting.
  • Do not add an array or json cast on translatable columns in $casts.
  • getTranslation() falls back to the fallback locale by default, use getTranslationWithoutFallback() for a strict lookup.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: resources/boost/skills/translatable-development/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md5 KB

Alternatives to translatable-development

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

translatable-development: common questions

How are translations stored in the database?

Translations are stored as JSON on the model itself, with one column per translatable attribute that holds all locales. The source says no extra tables or pivots are needed.

How do I set a translation for a specific locale?

Use setTranslation('name', 'nl', 'Hallo') for one locale, or setTranslations() with an associative array to set several locales at once.

What happens when a translation is missing?

By default getTranslation() returns the value from config('app.fallback_locale'). A model can turn this off with $useFallbackLocale = false or set its own fallback with getFallbackLocale().

How do I install translatable-development?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is translatable-development free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is translatable-development safe to use?

It scores 91 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to translatable-development?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

translatable-development Install

Add to stack

Loading.