bagisto/legacy-api
A compatibility layer for Bagisto that restores legacy API endpoints and response behavior, helping existing integrations keep working after upgrades. Bridges older API clients with modern Bagisto while preserving expected routes and payloads.
Architecture fit. bagisto/legacy-api is a compatibility shim, not a platform component. It re-exposes Bagisto's pre-upgrade REST conventions — catalog, search, cart, checkout, customer accounts, orders, invoices — on top of current core services, so it belongs in the integration tier of the architecture, running alongside the current API rather than replacing it. That is a good structural fit for a strangler-style migration: legacy and modern surfaces coexist behind distinct route prefixes, distinct middleware groups, and distinct rate limiters, and one can be retired without touching the other. What it is not is a versioned public API. There is no contract governance, no deprecation policy, and no supported-version matrix baked into the package — those become internal obligations the moment we install it.
Integration feasibility. Mechanically simple: a standard Laravel service provider, package discovery, a publishable config, and a Composer install. v1.0.0 (the only release, 2021-11-19) deliberately removed the module service-provider dependency and pulled JWT handling out of Bagisto core and into this package — which tightens the coupling to the JWT library but simplifies bootstrapping. The gating question is the three-version matrix: Bagisto core version, Laravel/PHP runtime, and the JWT dependency constraint must all be read off the 1.0.0 tag before engineering time is committed. If the bagisto/* constraint excludes our current major, this is a fork project, not an install project, and the estimate changes accordingly.
Technical risk. Ranked:
api can steal or lose routes to the current API depending on registration order and config cache state.Key questions for the team.
1.0.0 tag, and does it admit our stack?APP_KEY and from the primary API's guard?Stack fit. Laravel-native and conventional: service provider, published config, middleware pipeline, standard guard configuration. It slots into an existing Bagisto deployment without a new runtime, new datastore, or new deploy target. That is the main reason to prefer it over reproducing legacy conventions in-house — the glue is cheap; the ongoing ownership is not.
Migration path. Frame this as a time-boxed strangler bridge, approved as a migration ticket with an owner, a contract-test artifact, and a sunset date attached — not as a routine composer require.
1.0.0 composer.json constraints.composer require bagisto/legacy-api:1.0.0 --with-all-dependencies. No caret range — there is no release cadence to benefit from, and this ships auth-adjacent code.config:clear, route:clear, optimize:clear), and verify routes materialized via route:list, noting the actual prefix.legacy/api, api/v1-legacy), a dedicated middleware group, and explicit JWT secret/TTL via env.Compatibility. Two compatibility axes, both owned internally:
throttle:legacy rate limiter so a runaway mobile client cannot degrade the primary API. Assert in CI (via route:list --json) that no URI is duplicated across legacy and current route collections.Sequencing.
config/auth.php with its own provider and secret, keep it mutually exclusive with any Sanctum migration, and do not stack the two. One lands, then the other.dev-main as 1.0.0) early so JWT constraints or serializers can be patched without waiting for a release that will not come.Maintenance. This is an internal maintenance line item, not a vendor dependency — budget it that way from the start. The recurring work is: JWT security advisories, dependency bumps against a 2021 constraint set, drift fixes when Bagisto internals move, and fork rebases. Expect the Composer friction to concentrate on the JWT library; keep composer why-not in the runbook. A bridge with no named owner degrades into a permanently unsupported second API surface, at which point removing it is a client-release coordination problem rather than a config change.
Support. Community-only. No vendor SLA, no published security policy, no supported-version matrix, no upstream contract testing. Escalation for upstream silence is internal by default. The compensating controls are the contract-fixture suite (our detection mechanism for silent drift) and the fork (our remediation mechanism). Both must exist before go-live, not after the first incident.
Scaling. The bridge itself is thin — it translates requests onto core services — so it scales roughly with the primary API and adds middleware overhead, not a second application tier. The real scaling concern is isolation: a separate rate-limit bucket sized to actual legacy traffic, and a separate log channel and metrics dashboard tagged by route prefix. That separation is what keeps the blast radius visible when the bridge misbehaves or is attacked, without querying primary-API telemetry.
Failure modes to instrument explicitly.
route:list -v after every config change.optimize:clear first, artisan about second.Ramp-up. Low code-learning curve, high process-learning curve. An engineer familiar with Laravel service providers and Bagisto's domain can be productive on the package in a day; the expensive knowledge is operational — which guard signs which token, which prefix maps to which surface, what the fixtures cover, and what the rotation procedure is. Write the runbook the day you install it: secret rotation procedure, per-endpoint kill switch, contract-fixture update process, fork-and-patch procedure, and an escalation path that assumes upstream stays quiet. Plan for roughly one sprint to reach a trustworthy first-endpoint-plus-fixtures milestone, and treat cart/checkout enablement as a separate, later commitment gated on the sequence test passing.
How can I help you explore Laravel packages today?