mlevent/fatura
A Laravel package for generating invoices in PHP applications. Create itemized invoices with taxes, discounts, and customizable templates, then export them as PDFs for billing, accounting, or record-keeping workflows.
Architecture fit. mlevent/fatura is a Laravel-oriented PHP package for Turkish electronic invoice (e-Fatura / e-Arşiv) workflows. It abstracts draft creation, document generation, and status/query operations against a GİB-aligned or intermediary integrator endpoint, and exposes the result as an Eloquent-friendly model plus a service/manager class. It slots into the Laravel ecosystem as a standard Composer dependency with a service provider and publishable config — a conventional and low-friction fit for any Laravel monolith or modular monolith that already issues Turkish invoices.
Integration feasibility. Feasibility is moderate-to-good, with two hard prerequisites: (1) valid integrator/GİB credentials and a sandbox or test mali mühür (electronic seal) profile, and (2) a downstream consumer that can persist the returned invoice document identifier. The package itself is small and its surface area appears bounded to invoice lifecycle operations, so wiring it in is largely configuration plus a thin application service. The blocker is not code but commercial/onboarding access to the invoicing channel.
Technical risk. The dominant risk is maturity: at v0.3.x the package is pre-1.0, so semver gives no stability guarantee and minor bumps may alter method signatures or return shapes. The v0.3.3 notes are reassuring in direction but illustrate the risk pattern — two releases were spent correcting document identity resolution (ETTN/UUID extraction after draft creation) and document matching (disambiguating the "last document" query by buyer VKN/TCKN). Those are correctness bugs in the core reconciliation loop, not cosmetics, and their presence confirms the integration path is still stabilizing. Secondary risks: single-maintainer bus factor, Turkish-language documentation and error surfaces, and opaque dependence on an external invoicing provider whose uptime and rate limits sit outside the package's control.
Key questions.
Stack fit. Assumes a Laravel application (service provider registration, config publishing, facade/DI binding) on a currently supported PHP version. Verify the package's composer.json constraints against the host app before committing; pre-1.0 Laravel packages frequently lag the newest framework majors. If the host is Lumen or a non-Laravel PHP service, expect to instantiate the underlying client manually and forgo the framework glue.
Migration path. Greenfield — there is no incumbent to migrate from, and no prior internal assessment. Treat the first integration as a spike rather than a production commitment: stand up credentials, run the full draft → document → ETTN → query cycle in a sandbox, and only then design persistence. Because v0.3.3 changed how the document identifier is retrieved and how the "last document" is matched, any prototype code written against v0.3.1 must be re-validated rather than assumed correct.
Compatibility. Pin the dependency to an exact minor (e.g. 0.3.3) rather than a caret range given pre-1.0 semantics, and gate upgrades behind the sandbox suite. Confirm the package's HTTP client expectations (Guzzle version, TLS) and whether it tolerates the host's configured HTTP client. Validate Turkish character handling and timezone assumptions in invoice payloads against the host app's locale settings.
Sequencing.
0.3.3, publish config, and validate the service provider boots in the target environment.InvoiceGateway interface so the vendor dependency is swappable and testable with fakes.Maintenance. Low code volume, but non-trivial ongoing cost: pre-1.0 churn means each minor release needs a read of the diff and a sandbox re-run. The v0.3.1 → v0.3.3 gap touching core identity and matching logic is exactly the class of change that demands regression coverage. Budget for a pinned-version upgrade cadence rather than continuous tracking, and own a small integration test suite independently of the package's own tests — you cannot rely on upstream coverage for your reconciliation guarantees.
Support. Support is community/single-maintainer and Turkish-language. Internal capability must therefore include at least one engineer fluent enough in Turkish e-invoice domain terms (ETTN, VKN, TCKN, mali mühür) to debug provider errors, because error strings will surface from the package and the integrator in Turkish. Escalation beyond the maintainer routes to the invoicing integrator's support, which is a separate contract.
Scaling. Invoice issuance is a transactional, low-volume-per-second workload, so raw throughput is unlikely to bind. The real scaling concerns are (a) batch/period-end invoice runs, where sequential draft-then-query round trips will need queueing and concurrency limits respectful of provider rate limits, and (b) the query/polling pattern — the "last document" lookup approach fixed in v0.3.3 is inherently order-dependent, so parallel issuance for the same buyer must be serialized or made idempotent with our own correlation key.
Failure modes. Highest-impact: draft created but ETTN not captured (orphaned invoice, duplicate on retry) — the exact scenario v0.3.3 improves but does not eliminate; wrong document matched during query, previously possible when multiple documents existed for a buyer and now mitigated by VKN/TCKN scoping; provider/network timeout mid-submission leaving ambiguous state; and silent divergence between our persisted status and the provider's. Mitigations: idempotency keys per invoice attempt, persist the raw provider response before parsing, reconcile via a scheduled job, and treat "create succeeded, identifier unknown" as a first-class reconcile-needed state rather than an error to retry blindly.
Ramp-up. A competent Laravel engineer can integrate the happy path in days; reaching production confidence is a multi-week effort dominated by domain learning, not code. Plan for onboarding that covers Turkish e-invoice rules (document types, required fields, cancellation/objection windows) and provider-specific quirks, plus a written runbook for the reconcile and orphaned-draft cases. Do not treat this package as a turnkey compliance solution — it is a transport layer over a regulated process the team remains accountable for.
How can I help you explore Laravel packages today?