- How do I install and configure Transmatic in a Laravel application?
- Install the package with Composer using andrewdwallo/transmatic, then publish its config, assets, and migrations with the vendor:publish command. Run php artisan migrate so the package's translation tables exist before you use it. After that, add the Transmatic trait to each Eloquent model you want to translate and declare which attributes are translatable.
- Which Laravel and PHP versions does Transmatic support?
- Version 1.2.0 is a compatibility-widening release that explicitly adds Laravel 12 support, and the package is intended for Laravel 10 and 11 codebases as well. Check the composer.json constraints in the repository for the exact PHP and Laravel version matrix before upgrading. If your app is pinned to an end-of-life Laravel version, validate compatibility in a branch before merging.
- How does Transmatic store translations, and does it add extra columns to my tables?
- Transmatic keeps translations in its own database tables rather than adding a column per locale to your existing tables, so your original schema stays clean and new locales do not require new migrations. Publishing and running the package migrations is part of setup, so include that step in your deploy pipeline. Existing data is untouched because the approach is additive.
- How do I mark an Eloquent model attribute as translatable with Transmatic?
- Add the Transmatic trait to the model and declare the attributes that should be translated, typically through a property or method on the model itself. Once declared, the package stores and syncs translations for those attributes per locale. Attributes you do not mark are left alone, so you can roll it out one model at a time.
- Can I use a translation provider other than Google Translate with Transmatic?
- The package's core value proposition is automatic translation through Google Translate, so that is the documented default. Whether alternative drivers exist depends on the package's configuration options, so review the published config file and README for the supported driver list. If you need a different provider, confirm a supported driver or plan a custom adapter before committing.
- Will Transmatic conflict with my existing lang files or another localization package?
- Transmatic stores translations in the database, so it does not automatically import or rewrite your file-based lang entries. Expect the two systems to coexist at first, with database-managed keys handled by Transmatic and file-based strings left as they are. Inventory which keys live where before cutover, and avoid letting two translation managers own the same attributes.
- Do translations happen on every model save, and should I queue them in production?
- Translation goes through an external Google Translate API call, so doing it inline on every save can slow requests and consume quota quickly. Check the package config and docs for queue or artisan command options, and prefer dispatching translation work to a queue worker for bulk or production usage. Also review what content leaves your infrastructure and how API credentials are stored.
- How do I test Transmatic in my Laravel test suite without calling Google Translate?
- Because the package depends on an external translation API, tests should fake or stub that HTTP layer instead of making real network calls. Laravel's HTTP client fakes or a mocked translation driver let you assert that translations are requested and persisted without hitting Google. Keep any live-provider integration tests limited to non-production environments and a small set of cases.
- Is Transmatic safe for production, and how is the package maintained?
- It is a single-maintainer package with a modest release cadence, so weigh the bus factor and long-term support commitments against your team's risk tolerance. The 1.2.0 release is a widening compatibility update with no stated breaking changes, which suggests the maintainer is tracking current Laravel releases. For critical systems, review the license, CI and test posture, and pin versions with a plan to fork or replace if maintenance stalls.
- What alternatives to Transmatic exist for translating Laravel Eloquent models?
- Alternatives include Laravel's built-in lang files with manual translation, dedicated database-backed translation management packages, and general localization services whose APIs you call yourself. Transmatic's differentiator is Eloquent-level automatic translation with per-locale storage and no duplicate columns. Compare provider support, Laravel version coverage, and maintenance activity before deciding.