progrupa/edifact-bundle
A Symfony bundle that brings EDIFACT EDI handling to your application, wrapping the progrupa/edifact library so you can parse, read and generate electronic business documents through Symfony services and configuration.
What it actually is. progrupa/edifact-bundle is a thin Symfony bundle wrapper around the progrupa/edifact PHP parser for UN/EDIFACT interchanges (UNB/UNZ envelopes, UNH/UNT message segments, segment/element/composite traversal). The bundle itself contributes little beyond service-container registration, configuration plumbing, and possibly a compiler pass. That framing matters: the bundle is not the asset — the upstream parser is. The bundle is a convenience layer we could replace in an afternoon with ~50 lines of our own DI wiring.
Architecture fit. Poor-to-moderate for a Laravel codebase. Symfony bundles register through Bundle classes, Extension/Configuration trees, and kernel bootstrapping; Laravel has no equivalent auto-discovery mechanism for them. In a Laravel app the bundle would be inert — no service provider is auto-registered, no config is merged. The realistic path is to require the underlying progrupa/edifact library and expose it through our own service provider and facade. We should treat the bundle as documentation of intended usage, not as a dependency.
Integration feasibility. Parsing EDIFACT is the easy half; everything that makes an EDI integration succeed or fail sits above it — message-type schemas (ORDERS D96A, INVOIC D01B, DESADV), mandatory/conditional segment rules from the MIG, partner-specific deviations, code-list validation, and the mapping layer to our domain objects. This package addresses only the first half. Assuming a partner already hands us syntactically valid files and we control the mapping, a spike is a day or two. If we are expected to validate against message structures or generate outbound documents with correct segment ordering, the package covers well under half of the required scope and we will write the rest ourselves.
Technical risk (high).
Configuration deprecations, attribute-based autoconfiguration). An unmaintained bundle pins us to an aging framework era even though the app itself may be current.UNA service-string-advice segment redefining delimiters, the release/escape character, charset switching (UNOA/UNOB/UNOC), multi-message interchanges, and trailing-segment tolerance. Unmaintained parsers typically handle the happy path and fail silently on the rest.Key questions to answer before committing.
Stack fit. Assume Laravel. Do not install the bundle. Require progrupa/edifact directly (or vendor it if Packagist metadata is stale), and wrap it behind an internal contract:
EdifactParser interface — parse(string $raw): Interchange — implemented by a ProgrupaAdapter.Migration path.
UNA segment, and one multi-message interchange. Record where the parser lies or throws opaque exceptions.internal/edifact), tag a version, and consume via a VCS repository entry in composer.json. Budget for this; it is the likely outcome.Compatibility. Pin exact versions (no ^) and lock the PHP constraint. Test explicitly on our target PHP runtime. If the bundle pulls symfony/* sub-packages into a Laravel app, audit that for container/dependency conflicts — a stray Symfony major version can collide with packages like symfony/console pulled in by Artisan tooling.
Sequencing. Parser spike → adapter contract + golden files → inbound mapping and validation → outbound (only if in scope, and only after re-evaluating buy vs. build) → partner certification/parallel run. Do not sequence partner onboarding before the golden-file suite exists; you will debug in production against a counterparty who is also guessing.
Maintenance. This is the central cost. Zero-adoption packages are effectively abandoned-on-arrival, so we should plan from day one for internal ownership: one named engineer, a fork we control, and a documented upgrade path for PHP and framework majors. Estimate a standing 5–10% of one engineer's time in steady state, higher in the first two quarters. Compare that against a per-message commercial EDI gateway fee before deciding — at low message volume the gateway is usually cheaper than ownership.
Support. No upstream support channel. Incidents route to us. We should maintain an internal runbook covering: how to capture and redact a failing file, how to reproduce in the golden-file suite, and the escalation path to the fork owner. Partner-facing EDI failures are high-visibility (invoices don't post, orders don't ship), so an unclear escalation path is itself a business risk.
Scaling. Expect CPU-bound, in-memory parsing. Large interchanges (thousands of messages per file, or multi-megabyte ORDERS batches) may hit memory ceilings if the parser materializes the whole tree. Mitigations: split interchanges at the UNB/UNZ boundary before parsing, run in queued jobs with explicit memory limits, and avoid holding parsed trees for large batches. Throughput is unlikely to be the bottleneck at typical order/invoice volumes — correctness is.
Failure modes to instrument.
composer update resolving to a different commit. Pin and mirror.Ramp-up. Two distinct learning curves, and they compound: EDIFACT itself (segment syntax, message structures, partner conventions) and the idiosyncrasies of an undocumented library. Budget 2–3 weeks for a competent PHP engineer to become productive, most of it on the standard rather than the code. Pair the engineer with whoever owns the trading-partner relationship — that person holds the tribal knowledge about which segments the partner actually populates versus what the spec says.
Bottom line. Viable as a parsing primitive, not as a strategic dependency. The right TPM framing is: treat it as a small amount of borrowed code we are prepared to own outright, isolate it behind an interface, prove it against a real file corpus before committing, and keep a commercial EDI gateway on the table as the fallback if partner complexity exceeds our appetite for maintenance.
How can I help you explore Laravel packages today?