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

Automapper Plus Bundle Laravel Package

mark-gerarts/automapper-plus-bundle

Symfony bundle integrating AutoMapper+ for object mapping. Register mappings with AutoMapperConfiguratorInterface, autowire the automapper_plus.mapper service or AutoMapperInterface, and use automatic tagging with service autoconfiguration. Supports Symfony 3.4 through 8.x.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The first fact a TPM must establish is that this is a Symfony bundle, not a Laravel package, despite the "Laravel/PHP" framing. Its deliverable is AutoMapperPlusBundle, a Flex-registered bundle that auto-tags AutoMapperConfiguratorInterface implementations and exposes AutoMapperPlus\AutoMapperInterface as a Symfony container service. Laravel has no bundle-registration mechanism, no Flex recipe, and no service autoconfiguration tag equivalent — so the bundle's entire value proposition (zero-wiring DI integration) evaporates on a Laravel stack. The genuinely reusable asset is the framework-agnostic mark-gerarts/automapper-plus core library, which could be bound into Laravel's container behind a thin custom service provider. Consequently, the decision a TPM owns is not "should we install this bundle" but "do we want a mapping-abstraction layer at all, and if yes, do we fund the ~1–2 days of glue code to make the core library idiomatic in Laravel?" A mapping layer earns its keep where DTOs, value objects, and CQRS/clean-architecture boundaries are already architectural commitments. It is over-engineering where Eloquent API Resources and straightforward array shaping already suffice.

Integration feasibility. On Symfony 6.3+/PHP 8.1+, integration is routine Composer work: install, register the bundle, write configurator classes, enable autoconfigure. On Laravel, the bundle is not a viable integration unit; you would be shipping Symfony FrameworkBundle, DependencyInjection, and Config components into a parallel container purely to obtain a mapper — an anti-pattern with real weight. The feasible path is composer require mark-gerarts/automapper-plus, a small AutoMapperServiceProvider binding a singleton AutoMapper built from configurators, and a config file for the four supported options. That is custom, unsupported engineering the TPM must budget and own, plus new test surface (mapper unit tests, per-profile fixtures).

Technical risk. The dominant risk is maturity, not code quality. 65 stars and 0 dependents means essentially no production corroboration and no ecosystem pressure to keep it correct; a single maintainer drives a bus-factor of one. The release cadence looks healthy on paper (through Symfony 8 / PHP 8.5), but that is compatibility maintenance, not evidence of adoption. Secondary risks: reflection-based mapping performance on bulk paths requires benchmarking against hand-written code; the mapping DSL is a niche skill with a learning curve; and errors surface through an abstraction, making debugging slower than reading an explicit constructor. On Laravel specifically, there is an additional risk that the core library's property-accessor assumptions (getter/setter conventions) don't align cleanly with Eloquent's magic __get/__set attribute model.

Key questions.

  • Is the target codebase actually Laravel? If so, the bundle is out of scope and we are really evaluating the core library — is that the decision we think we're making?
  • What concrete problem are we solving — DTO hydration for an API layer, domain-to-view-model transformation, or microservice contract shaping? If we can't name three files it would replace, it's a solution seeking a problem.
  • Why this over spatie/laravel-data, Eloquent API Resources, symfony/serializer normalizers, or ~200 lines of hand-written mapper? What does it do that those cannot?
  • What is the mapping volume and complexity — flat field copies, or nested/conditional/collection graphs where a declarative config genuinely beats imperative code?
  • Who is the internal owner of the mapping profiles, and do they have capacity to absorb an unmaintained dependency?
  • Are we willing to pin to an exact patch version and accept that a breaking upstream change may never be fixed?

Integration Approach

Stack fit. Good fit: Symfony 6.3+/PHP 8.1+ codebases with established DTO layers, complex nested transformations, or multiple transport boundaries needing consistent object shaping. Conditional fit: a Laravel codebase that already has a DTO/action-layer convention and wants declarative mapping — but only via the core library, not the bundle. Poor fit: Laravel apps expecting drop-in behavior, simple CRUD applications, teams standardized on spatie/laravel-data or API Resources, and any codebase where mapping is trivial enough that a constructor or a toArray() is clearer.

Migration path. (1) Audit first — grep the codebase for hand-written mapping (manual new Dto(...), array-to-model loops, repeated ->only()/->map() chains) and quantify duplication. This is the go/no-go artifact. (2) Decision gate on platform: Symfony → adopt the bundle directly; Laravel → adopt the core library behind a custom provider, or reject. (3) Pilot one module with a small, well-understood mapping set; instrument it. (4) Establish conventions — configurators as versioned classes under app/Mappers or src/Mapper, one profile per source-target pair, no closure logic longer than a few lines. (5) Roll out module-by-module behind feature flags, keeping the old manual mapping until parity tests pass, then delete it in a dedicated PR so the diff is reviewable.

Compatibility. Symfony 3.4–8.x and modern PHP are claimed for the bundle; the core library is ORM-agnostic, so Doctrine and Eloquent entities both work in principle. Laravel compatibility is explicitly untracked — treat it as custom work with no upstream guarantee, and expect to re-validate on every Laravel major. If the bundle path is chosen, the Symfony/PHP version is a hard prerequisite that may force a platform upgrade first. Ensure OPcache/APCu is sized appropriately so compiled mapping metadata is cached rather than rebuilt per request.

Sequencing. Audit → decision gate (platform + problem statement) → platform/PHP upgrade if required → mapping conventions agreed and documented → single-module pilot with a benchmark → mapping assertion test harness → gradual replacement of manual code → observability on mapping error rates and bulk latency. Do not sequence anything before the decision gate; on a Laravel stack, installing the bundle would be pure waste, and even on Symfony the layer is unjustified absent a real duplication problem.

Operational Impact

Maintenance. Centralized mapping genuinely reduces duplication and enforces consistency — a real TCO win once the number of DTO/entity pairs crosses roughly a dozen. The cost is a new owned artifact: the profile definitions. Config drift between profiles and evolving domain models is the recurring failure mode, and it is mitigated only by (a) keeping profiles in version control next to the models they map, (b) adding static analysis (PHPStan/Psalm) that validates referenced properties exist, and (c) requiring profile changes in the same PR as any model change. The single-maintainer upstream is a standing risk requiring a named internal owner and a pin-to-patch dependency policy.

Support. MIT, community-driven, no SLA, no vendor escalation path. Support is GitHub issues on a project with 65 stars — realistically, the team is on its own for anything beyond a straightforward bug. Budget for an internal runbook covering the recurring patterns: nested objects, collection mapping, custom value resolution, and the property-accessor choice (SymfonyPropertyAccessorBridge for strictness vs DecoratedPropertyAccessor for private-property tolerance — a decision that materially changes behavior and should be made once, deliberately, and documented).

Scaling. Two axes. Runtime: reflection-based mapping must be benchmarked on realistic bulk paths (1,000+ records, serializing a collection endpoint); if hot-path latency regresses, keep hand-written mapping there and use the abstraction for the long tail — a hybrid is legitimate and should be stated up front rather than discovered in production. Team: the stronger argument is onboarding velocity — declarative, testable profiles beat bespoke mapping scattered across controllers, provided the team invests in the DSL learning curve. Note that AutoMapper configuration becomes a specialized skill a small number of engineers will hold.

Failure modes. (1) Missing-property and type-mismatch errors surfacing at runtime rather than at build time — mitigate with startup smoke tests and static analysis. (2) Silent mis-mapping from null/default/ignore_null_properties handling, where wrong data flows without an exception — the most dangerous mode; mitigate with assertion-based tests on representative fixtures. (3) Config drift after domain model changes. (4) Performance regressions in hot loops after an upstream bump. (5) Upstream abandonment or an unpatched CVE with no fork strategy. (6) On Laravel, subtle breakage from property-accessor mismatch with Eloquent's magic attributes.

Ramp-up. Expect roughly a week for one engineer to become productive and about a month to become the team's authority; the core library's documentation is decent but the ecosystem around it is thin, so most answers come from reading source. Ramp-up should be front-loaded into the pilot module, with the resulting conventions captured as a short internal doc and two or three exemplar profiles that new hires can copy. If the team cannot allocate that owner, the honest recommendation is to decline the dependency and use spatie/laravel-data (Laravel) or hand-written mapping (Symfony) instead.

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.
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log
hsluv/hsluv
seampact/codegen
seampact/hooks
seampact/ir
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk