babymarkt/deepl-php-lib
A PHP client for the DeepL translation API by babymarkt. Translate text across languages, manage glossaries, and integrate DeepL into Laravel or any PHP application through a clean, framework-agnostic interface.
Architecture fit
babymarkt/deepl-php-lib is a framework-agnostic HTTP wrapper around the DeepL REST API (translate, glossaries, usage). It ships no Laravel service provider, no facade, no publishable config, and no symfony/translation bridge — so it does not slot into Laravel's localisation pipeline the way a first-party integration would. Architecturally it is only appropriate as a leaf dependency behind an application-owned adapter: define a TranslationProvider contract in the app, implement it once against this SDK, and bind it in a service provider. In that shape the fit is acceptable; as a directly-called library scattered across controllers and jobs, it is not.
Integration feasibility
Feasible, with wrapper work. Composer constraints are the first gate: the package targets PHP >= 7.3 and was last released 2022-06-13, so its transitive pins (Guzzle, PSR-7/17/18, psr/http-message 1.x vs 2.x) are the most likely sources of install conflicts against a modern Laravel app that already requires guzzlehttp/guzzle ^7. Expect to test-resolve or alias. Runtime behaviour on PHP 8.1–8.3 is plausible but unverified — deprecated implicit-nullable parameters and dynamic-property warnings are the usual failure points for libraries of this vintage. The SDK surface itself is small and easy to exercise, so a two-day spike can settle feasibility.
Technical risk
The dominant risk is lifecycle, not code quality. The repository is archived: no security response process, no DeepL API-version tracking, no PHP 8.4+ compatibility, no bug fixes. With 0 dependents and 49 stars there is effectively no community validation or de-facto peer review — you would be one of the only operators running it in production. Compounding this, DeepL's API has moved since 2022 (v1 endpoint sunset, DeepL-Auth-Key header auth and split free/pro hostnames, glossary and document-translation evolution, formality and context parameters). A 2022 client may still work against current endpoints but is unlikely to expose newer capabilities, and any breakage is permanent because nobody is patching upstream. MIT licensing is clean; supply-chain risk is low but non-zero given the frozen dependency tree.
Key questions
DeepL-Auth-Key header and target the current api.deepl.com / api-free.deepl.com hosts, or the deprecated auth_key parameter?deepl-php client?TPM verdict: suitable as a reference implementation or throwaway prototype; not suitable as a long-lived production dependency in its archived state. Budget for either a maintained fork or a migration to a supported client, and let the adapter contract make that swap a one-file change.
Stack fit
Assumes Laravel 9–11 / PHP 8.1+. The integration belongs in three places only: a config/deepl.php (key, host, default source/target languages, glossary ID, timeout, retry policy), a TranslationServiceProvider binding TranslationProvider to a DeepLTranslationProvider, and queued jobs for bulk work. Keep the SDK out of controllers, Blade, and models. Credentials come from .env via config, never from the package directly, and should be scoped to a dedicated DeepL API key per environment so quota consumption is attributable.
Migration path
Because the upstream is archived, treat adoption as a fork decision, not an install decision. Preferred order: (1) adopt the vendor-maintained deepl-php client if it covers the required features; (2) if this library exposes something the official client does not, vendor it into packages/ or a private VCS fork with an explicit owner and upgrade policy; (3) only then consider a bare composer require in a non-critical path. Whichever route, the application-facing contract must be provider-neutral so (1) and (2) are interchangeable.
Compatibility
Resolve composer constraints in isolation first (composer why-not against Guzzle and PSR versions). Verify on the production PHP minor, not just the dev container. Check declare(strict_types=1) behaviour, return types on PHP 8.3+, and any use of utf8_encode/utf8_decode (removed in 8.2) or FILTER_SANITIZE_STRING (deprecated). Add a smoke test in CI that hits DeepL's free-tier endpoint with a single short string so an upstream API change fails the build rather than production.
Sequencing
TranslationProvider with translate(string|array, source, target, options) and usage().usage() to track quota consumption.Maintenance
The core operational fact is that upstream maintenance is zero. Someone internally must own the fork: watching DeepL's API changelog, applying dependency bumps, and re-releasing. That is a recurring, unbudgeted cost that will not appear on any roadmap until the day the API changes. Recommend pinning to an exact version, storing the fork in a private registry, and adding a quarterly review item.
Support
No upstream issue triage, no maintainer contact, no security advisories. Support is entirely internal. For a translation dependency this is tolerable (failures are loud, not silent), but it means on-call must be able to distinguish DeepL outages from SDK defects using only logs.
Scaling
Throughput is bounded by DeepL, not by PHP: concurrency limits per plan, per-request payload caps, and the monthly character quota. Batch at 50 texts per call, cap worker concurrency with a dedicated queue and a Redis-based rate limiter, and never translate inside a synchronous request path. Character-volume growth is the real scaling cost driver — instrument characters sent per day against plan quota and alert at 70%.
Failure modes
403 — invalid/rotated key; fails fast and uniformly, easy to detect.429 — rate limit; requires backoff plus queue throttling, otherwise retry storms amplify the outage.456 — quota exhausted; hard stop, needs a kill switch and a human-visible alert rather than silent untranslated fallback.413/414 — oversized payloads; enforces the batching discipline.5xx — DeepL degradation; retry with jitter, then fall back to source language with a flag on the record.formality changes not supported by the 2022 client produce subtly wrong output that passes all health checks. This is the failure mode most likely to reach customers.Ramp-up
Low for the happy path — the API is small and a competent Laravel engineer is productive in half a day. Moderate for the operational hardening (rate limiting, quota guardrails, exception normalisation, fork governance), which is where most of the effort actually sits. Plan for roughly a 3–5 day first increment plus a standing maintenance obligation, and be explicit with stakeholders that the maintenance line item exists specifically because the package is archived.
How can I help you explore Laravel packages today?