justbetter/laravel-dynamics-client
A Laravel package that provides a fluent client for Microsoft Dynamics, making it easy to query, create and update records from your app. Includes configurable connections, authentication and a clean, Eloquent-like interface for working with Dynamics entities.
Release under review: 2.1.0 (patch) — Fix empty JSON object for requests without parameters (PR #47, first-time contributor @FinnPaes). No breaking changes, no new public API surface, no deprecations announced. Changelog diff is 2.0.0...2.1.0 with a single fix.
Package profile (inferred, to be validated): justbetter/laravel-dynamics-client is a Laravel wrapper around the Microsoft Dynamics 365 Business Central OData/Web API — service provider + facade/client, config-driven tenant and environment credentials, and a query/resource layer for OData entities. Version 2.x implies a modern Laravel baseline (10/11-era) and PHP 8.1+.
Architecture fit
deltaLink), or heavy batch throughput. This is a synchronous HTTP client; those concerns must be designed around it.Integration feasibility
.env and a secrets manager.{}), which OData endpoints and strict intermediaries can reject. Teams should expect fewer spurious 400s on no-payload calls (e.g., parameterless actions, DELETE, or GETs where a Content-Type: application/json header accompanied an empty body). This is a silent reliability improvement, not a feature.Technical risk
429 with Retry-After. Confirm the client honors it and that your retry policy is bounded and idempotent — retrying a POST blindly will duplicate records.{} body can be simplified, but leaving it is harmless.Key questions
429/Retry-After, transient 5xx, and token refresh mid-request? Is retry built in or ours to implement?Stack fit
DynamicsGateway with findCustomer(), upsertOrder(). Bind the package-backed implementation in a service provider; mock the interface in tests.Migration path
^2.1, publish config, do not pin below 2.1.0 — the empty-body fix removes a class of confusing 400 responses that would otherwise burn debugging time during initial integration.2.0.x: drop-in. Bump the constraint, run the suite, deploy. Expect behavior change only on calls that previously sent an empty body — audit those paths for downstream workarounds.Compatibility
^2.1 and pin Laravel/PHP constraints explicitly in composer.json; do not rely on the package's own constraints to hold your platform version.Sequencing
429 and a 401 to observe behavior. Output: a one-page risk note.Maintenance
composer update on a quarterly cadence plus immediate action on security advisories.Support
Scaling
$filter and $expand usage in code review.Failure modes
| Mode | Symptom | Mitigation |
|---|---|---|
| Expired/rotated client secret | 401 across all calls, sudden | Rotation calendar + pre-expiry alert; secret in a manager, not .env on disk |
Throttling (429, Retry-After) |
Latency spikes, queue backlog | Honor Retry-After, bounded exponential backoff, queue depth alerting |
| Tenant schema drift | 400/404 on a previously working field | Contract tests per environment; alert on error-rate change, not just on exceptions |
Partial write / duplicate POST |
Duplicate records in ERP | Idempotency keys or external-ID lookup-before-create; retries only on safe verbs |
| Empty-body rejection (pre-2.1.0) | Unexplained 400 on no-parameter calls | Resolved by 2.1.0 — verify the fix in sandbox before relying on it |
Silent 5xx from intermediary |
Intermittent failures, hard to reproduce | Log full request ID + correlation ID; Dynamics returns a x-ms-correlation-request-id — capture it |
| Upstream abandonment | No fixes for new Laravel versions | Fork contingency, tested once |
Ramp-up
$filter, $select, $expand, $batch) and Business Central's entity model — allow 1–2 weeks to genuine proficiency.^2.1, behind an internal abstraction, with a named owner and a fork contingency. The 2.1.0 fix is a low-risk maintenance win that removes a recurring class of debugging pain; it does not change the integration calculus, but it is the version to start on.How can I help you explore Laravel packages today?