一键导入
translations
Translation and localization conventions for Laravel. Use when adding user-facing strings, creating translation files, or working with lang/ directory.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Translation and localization conventions for Laravel. Use when adding user-facing strings, creating translation files, or working with lang/ directory.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Readonly data containers with typed factory methods (`fromArray`, `fromModel`, `fromCollection`, `fromRequest`) used to pass structured data between application layers — especially for external API responses, Eloquent models, and service boundaries. Use this skill whenever creating, reviewing, or refactoring DTOs, Data Transfer Objects, value objects for inter-layer communication, or mapping payloads from APIs, models, or collections into typed PHP objects. Also trigger when the user mentions spatie/laravel-data alternatives, data mapping, or payload normalization in a Laravel context.
Eloquent model conventions for mass assignment, casts, relationship naming, activity logging, and mandatory model tests (CRUD + relations).
Single-purpose business logic classes that encapsulate one well-defined business operation. Actions are the primary location for business logic in Laravel applications, invoked from controllers, commands, or jobs.
Albatros accounting API integration via Saloon. Use when working with app/Services/Albatros/, AlbatrosConnector, or Albatros DTOs.
Laravel Blade template conventions covering components, output escaping, security, structure, and formatting.
Artisan console command classes that serve as the CLI entry point for operations. Commands validate input and delegate all business logic to Actions or Services.
| name | translations |
| description | Translation and localization conventions for Laravel. Use when adding user-facing strings, creating translation files, or working with lang/ directory. |
| compatible_agents | ["implement","refactor","review"] |
en and de.lang/ directory or translation test coverage.__() or @lang()en) and German (de) — add keys to both locales when creating new translationslang/{locale}/{group}.php) for domain-specific terms (e.g. sprints., organizations.)lang/{locale}.json) for generic UI labels (Save, Back, Cancel, etc.):placeholder for dynamic values in translation stringsphp artisan test --filter=MissingTranslationMissingTranslationTest.php scans for __(), trans(), and @lang() and verifies every key exists in every locale// lang/en/sprints.php — namespaced keys for domain-specific strings
return [
'step_locked' => 'This step is locked.',
'create_success' => 'Sprint :name was created successfully.',
];
// Usage
__('sprints.step_locked');
__('sprints.create_success', ['name' => $sprint->name]);
// lang/de.json — generic UI labels
{
"Save": "Speichern",
"Back": "Zurück",
"Cancel": "Abbrechen"
}
// Usage
__('Save');
__('Back');
{{-- In Blade templates — always use translation helpers --}}
<button type="submit">{{ __('Save') }}</button>
<p>{{ __('sprints.step_locked') }}</p>
<p>{{ __('Configure the :provider API key.', ['provider' => $provider]) }}</p>
// In PHP — use trans() or __()
throw new ValidationException(__('validation.required', ['attribute' => 'email']));
Log::info(__('sprints.import_started', ['count' => $count]));
// Recommended workflow for adding a new domain key
// 1) Add key to lang/en/sprints.php
// 2) Mirror the same key in lang/de/sprints.php
// 3) Use __() in code
// 4) Run: php artisan test --filter=MissingTranslation
__() or @lang().lang/en/* and lang/de/*.MissingTranslation tests pass after changes.'Save' or 'This step is locked.' directly in views or PHP:placeholder syntax for dynamic values: __('Welcome, :name') with ['name' => $user->name]php artisan test --filter=MissingTranslation after adding or changing translationsREADME.md — project-level language setup and testing commandsBlade/SKILL.md — use __() in Blade for all user-facing textPHPUnit/SKILL.md — MissingTranslationTest validates translation coverage