Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Auto Mapper Bundle Laravel Package

retailcrm/auto-mapper-bundle

Symfony bundle integrating RetailCRM AutoMapper to automatically map arrays and objects to typed DTOs. It simplifies request/response hydration with service auto-configuration and support for nested and collection mappings.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • The package is an object-to-object mapper delivered as a Symfony bundle, not a Laravel package. Despite the "Laravel/PHP" framing, its integration surface is Bundle registration, DI container compiler passes, and service tagging — none of which exist in a Laravel application without adaptation.
  • Its value proposition is convention-based mapping: instead of hand-writing toDto()/fromEntity() methods or configuring a third-party mapper, the bundle auto-discovers mapper services and wires them through the container. This is architecturally a DTO/hydration layer concern, sitting between the persistence layer (Doctrine/Eloquent) and the transport layer (controllers, API resources, queue consumers).
  • For a Laravel codebase the native equivalents already occupy this space: API Resources, spatie/laravel-data, or explicit Mapper classes. Adopting this bundle means introducing a second, Symfony-oriented abstraction for a problem Laravel already solves idiomatically — a net increase in conceptual surface area.
  • Where it would fit cleanly is a codebase already on Symfony (or a Laravel app with a substantial Symfony-component-based internal library) where multiple bounded contexts need consistent, low-ceremony entity↔DTO translation.

Integration feasibility

  • Low as shipped. There is no Laravel service provider, no façade, no config publishing. A Laravel integration requires: (a) bypassing the Bundle class, (b) manually registering the mapper services and any tag-based collection logic, (c) replacing Symfony's autowire/autoconfigure assumptions with Laravel's container bindings or a custom compiler-like registration step.
  • High within Symfony. A single bundles.php entry plus attribute/tag configuration, and mappers resolve automatically. This is the package's intended and only well-trodden path.
  • Mapping correctness is verifiable only through generated/reflective logic; there is no obvious schema or contract artifact to diff in CI, so verification relies on unit tests per mapper.

Technical risk

  • Adoption risk is the dominant risk. 1 star and 0 dependents means effectively zero production evidence in the wild. There is no community backstop: no Stack Overflow corpus, no third-party blog posts, no ecosystem of extensions. Every edge case becomes a first-principles investigation for our team.
  • Bus factor / continuity. A single-vendor package (RetailCRM) with negligible external usage. If RetailCRM's internal priorities shift, the package can be archived with no fork momentum to sustain it. MIT license mitigates the legal risk — we can vendor and patch — but not the maintenance cost.
  • Release date anomaly. A "last release" of 2026-08-03 warrants direct verification: either the metadata is unreliable, the package is pre-1.0/pre-release, or the registry data is malformed. Any of these is a yellow flag on release discipline and provenance.
  • Reflection/attribute dependence. Auto-mapping typically relies on reflection and/or PHP attributes. That introduces runtime cost on hot paths and couples the mapping contract to class shape — refactors of DTO properties can silently change mapping behavior without a compile-time error.
  • Debugging opacity. Convention-over-configuration mappers fail in ways that are hard to trace ("field is null because the source property name didn't match"). Without strong error messaging, this becomes a recurring tax on mid-level engineers.

Key questions

  1. Is the Laravel requirement non-negotiable, and if so, has anyone published a Laravel adapter (or must we write and own one)?
  2. What is the actual release history and PHP/Symfony version support matrix? Does the 2026-08-03 date reflect a real, tagged, installable release?
  3. Does the mapper perform reflection on every call, or is there a compiled/cached mapping plan? What is the measured per-object overhead versus a hand-written mapper?
  4. How does it behave on mismatch — silent null, exception, or configurable strictness? Strict mode is a hard requirement for us.
  5. Is there a documented extension point for custom type conversion (value objects, enums, collections, money, dates with timezones)?
  6. Who maintains it internally at RetailCRM, and is there any stated support commitment beyond "MIT, no warranty"?

Integration Approach

Stack fit

  • Symfony 6/7 applications: strong fit. composer require retailcrm/auto-mapper-bundle, register in config/bundles.php, tag mapper services. Zero-friction if the team already uses Symfony's DI heavily.
  • Laravel applications: poor fit as-is. Feasible only as a vendored library behind our own adapter — a MappingServiceProvider that reads a config array of mapper classes, binds them as singletons, and exposes a thin Mapper contract. We would own that adapter indefinitely.
  • Framework-agnostic PHP services: possible but requires replicating the container wiring manually, which erodes most of the package's benefit — at which point a plain interface plus hand-written mappers is competitive.

Migration path

  • Do not migrate existing mapping code. Introduce the mapper additively at a single seam — one new bounded context, or one new integration (e.g., an outbound API payload builder) — where no mapping layer exists yet.
  • Define our own MapperInterface in application code and treat the package as one implementation behind it. This preserves optionality: swapping to spatie/laravel-data, Symfony Serializer, or hand-written mappers becomes a local change rather than a codebase-wide refactor.
  • If the package is adopted, vendor it ("repositories" with a VCS pin or a path repository) so that upstream archival or an incompatible release cannot break our build.

Compatibility

  • Confirm PHP version floor against our runtime matrix (8.1/8.2/8.3) and pin the constraint explicitly.
  • Confirm Symfony component version constraints if we run a hybrid or Laravel-with-Symfony-components stack; conflicting symfony/* constraints are the most likely install failure.
  • Check for doctrine/* or serializer coupling that would drag in transitive dependencies we don't already carry.
  • Verify attribute vs. annotation vs. config-based mapper declaration — attribute-only support is a hard blocker on older PHP.

Sequencing

  1. Spike (1–2 days): stand up a throwaway Laravel app, hand-write the adapter, map three non-trivial object graphs (nested, collection, enum/value object). Measure the effort honestly.
  2. Verification: confirm the release is installable and inspect the actual changelog/tags; resolve the 2026-08-03 anomaly before any further investment.
  3. Decision gate: if the adapter exceeds ~2 days or strict-mode/type-conversion gaps require forking, stop — the build-vs-adopt math favors hand-written mappers or spatie/laravel-data.
  4. Pilot (1 sprint): one production-adjacent use case behind our MapperInterface, with contract tests pinning expected field-by-field output.
  5. Scale-out only after the pilot proves stable, and only with the vendor pin in place.

Operational Impact

Maintenance

  • Budget for ownership of the adapter layer, not just usage. In a Laravel context we are effectively the package's maintainer for our stack.
  • Upgrade cadence is our responsibility because there is no user community generating compatibility reports. Each PHP minor and each framework upgrade requires us to independently validate the package.
  • Reflection/attribute-based contracts mean DTO refactors can change behavior silently. Mitigate with mandatory per-mapper unit tests asserting full output shape — a non-negotiable team convention, not a nice-to-have.

Support

  • No commercial support, no active community, no issue-tracker triage velocity to rely on. Internal escalation path must terminate with "we fork and patch," so at least one engineer needs to be comfortable reading the bundle's compiler passes and mapper internals.
  • Document the vendor pin and the fork procedure in the runbook; a package this small is a plausible archival risk within 12–24 months.

Scaling

  • Mapping is CPU-bound and typically per-request or per-message. Reflection-based mapping adds measurable overhead in list endpoints (mapping hundreds of entities per response) and in high-throughput queue consumers.
  • Establish a benchmark before scaling: map N=1,000 objects, compare against hand-written mappers. If overhead is material, restrict the package to low-volume paths (single-record API responses, admin flows) and keep hot batch paths hand-written.
  • Memory profile should be flat per call; watch for mapper instances being re-instantiated rather than resolved as singletons.

Failure modes

  • Silent nulls on property mismatch — the highest-severity failure because it produces corrupt-but-valid data downstream. Require strict mode or explicit field mapping with tests.
  • Dependency resolution failure on framework/PHP upgrades — build breaks, not runtime breaks, so at least it's loud.
  • Behavioral drift across package versions with no changelog discipline — data shape changes without a corresponding change in our repo. Mitigated only by the vendor pin and contract tests.
  • Debugging latency — engineers unfamiliar with convention-based mapping will lose hours to "why isn't this field populated." Onboarding cost is real even at a 1-day ramp.
  • Bus factor — a single upstream maintainer's decision can strand the dependency. MIT fork rights are the only real hedge.

Ramp-up

  • Symfony-fluent engineers: under a day. The concepts (tagged services, autowiring, convention mapping) are familiar.
  • Laravel-only engineers: 1–2 days, mostly spent on the container adapter and on understanding why the abstraction exists when API Resources already do the job — expect some justified skepticism.
  • Team-wide: write a one-page internal standard covering how to declare a mapper, how to assert output, and when not to use the package. Without this, adoption will be inconsistent and the codebase will end up with both hand-written and auto-mapped translation logic — the worst outcome.
  • Net assessment: technically coherent in its intended Symfony context, but at 1 star / 0 dependents the operational risk profile is that of a self-maintained internal library. Adopt only behind an owned abstraction, only on a non-critical seam, and only if the spike proves the Laravel adapter is trivial. Otherwise, prefer the framework-native or mainstream-ecosystem alternative.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator