translatable-models

Generate multi-language Eloquent models with migrations, seeders, and factories.

Updated Feb 4, 2026
One-click install
npx skills add https://github.com/Saidabbos/homemessage-admin --skill translatable-models
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: translatable-models
Source: https://github.com/Saidabbos/homemessage-admin/tree/main/.ai/skills/translatable-models
Command: npx skills add https://github.com/Saidabbos/homemessage-admin --skill translatable-models

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines building multi-language Eloquent models and the corresponding translation infrastructure, eliminating repetitive boilerplate and ensuring consistent localization.

Core Features & Use Cases

  • Model scaffolding with translation support: generate a canonical model (for example, Article) using spatie/laravel-translatable.
  • Migration & translation tables: create the main table and a translations table with locale-specific fields and constraints.
  • Seeders & factories for multilingual data: provide sample data across locales for development and testing.
  • Best practices guidance: configuration of the $translatable property, non-translatable columns, and locale-aware queries.

Quick Start

Install Laravel and the spatie/laravel-translatable package, then run the steps in this skill to scaffold a translatable model (e.g., Article) with migrations, seeds, and a translation-ready data structure. Then create additional locales and test queries like getting translations per locale.

Frequently Asked Questions about translatable-models

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create multi-language Eloquent models in Laravel without writing repetitive boilerplate?

To create multi-language Eloquent models, you can scaffold translatable model classes, migration tables, and seeders automatically. This generates the required translation infrastructure using the spatie/laravel-translatable package, eliminating manual boilerplate for localized content like products or articles.

What is the best way to structure translation tables for a Laravel application?

The best way to structure translation tables is to generate a main table alongside a dedicated translations table. This translations table includes locale-specific fields and constraints, ensuring a consistent data structure for managing multiple locales within your Eloquent models.

Does Laravel i18n model scaffolding work with the spatie/laravel-translatable package?

Laravel i18n model scaffolding works directly with the spatie/laravel-translatable package. It configures the translatable property on your Eloquent model classes and outputs the translation tables and example seed data needed for localization.

How do I generate seeders and factories for multilingual Eloquent data?

You can generate seeders and factories for multilingual Eloquent data by automating the creation of sample data across multiple locales. This provides locale-aware development and testing data ready for your content-driven entities like pages and articles.

What do I need to set up before scaffolding translatable models in Laravel?

Before scaffolding translatable models, you need a working Laravel environment and the spatie/laravel-translatable package installed. This Skill requires this specific Laravel tooling to output the model classes, translation tables, and example seed data correctly.

When should I use a dedicated translation table for my Eloquent models?

You should use a dedicated translation table for Eloquent models when managing content-driven entities like products, articles, and pages across multiple locales. This approach handles locale-specific fields and constraints while keeping non-translatable columns separate.