flobbos/laravel-translatable-db
Store model translations in a dedicated database table with Laravel. flobbos/laravel-translatable-db adds a simple translatable trait, helpers, and query support so you can persist and retrieve localized fields cleanly without JSON columns.
middleware_default=false, to_array_always_loads_translations=false) reduce unintended side effects, improving security and performance.composer.json and testing middleware/relation logic.middleware_default=false may break existing locale-aware routes if not explicitly reconfigured.to_array_always_loads_translations=false could expose N+1 query risks if not managed (e.g., eager loading translations).locale_key handling imply prior bugs; validate existing implementations for regressions.SetLocale) adapt to middleware_default=false?to_array_always_loads_translations=false, how will APIs handle dynamic translation inclusion/exclusion?title_en)?Illuminate\Contracts\Translation\Translator).jsonb for complex queries.composer.json for Laravel 10+ dependencies.SetLocale) for middleware_default changes.to_array_always_loads_translations=false).spatie/laravel-activitylog) for relation/translation interactions.composer.json and run composer update.php artisan vendor:publish --tag="translatable-config").$translatable arrays and test new defaults.withTranslations()).SetLocale or similar middleware to respect middleware_default=false.to_array_always_loads_translations).to_array_always_loads_translations=false reduces memory usage but may increase N+1 queries; use eager loading strategically.cache()->tags(['product:1', 'locale:en'])).| Scenario | Impact | Mitigation |
|---|---|---|
| Middleware misconfiguration | Broken locale resolution | Feature flags + default middleware |
| Missing fallbacks | Inconsistent translations | Validate fallback logic in Testbench |
| N+1 queries | Performance degradation | Eager load translations (withTranslations()) |
| Testbench failures | Untested translation edge cases | CI gate for Testbench validation |
| Locale key conflicts | Data corruption | Schema validation + backups |
How can I help you explore Laravel packages today?