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.
registerMapping(Employee::class, EmployeeDto::class) plus forMember(...) closures) living in versioned configurator classes. That supports a roadmap decision on whether entities ever leak past the service boundary, and whether API/view-model contracts are explicit code or ad-hoc array shaping.mark-gerarts/automapper-plus, (b) spatie/laravel-data, (c) Eloquent API Resources, (d) a ~200-line in-house mapper. This package is the cheapest buy option to evaluate — MIT, one Composer require, no vendor contract — so it is worth a timeboxed spike purely to price the build alternative against something concrete.AutoMapperConfiguratorInterface autoconfiguration and an automapper_plus.configurator tag with priorities — machinery with no path into Laravel's service-provider model. On a Laravel stack the leverageable asset is the framework-agnostic core library behind a thin custom provider, which is new engineering we must budget for. A PM should frame this as "adopt the mapping pattern and possibly the library," never "adopt the bundle."fromProperty('some.nested[child]') paths cover most real transformation logic without hand-written loops.spatie/laravel-data already cover our needs — a useful, low-cost closure on a recurring backlog question.Consider it when:
skip_constructor, ignore_null_properties, use_substitution) — where a DSL earns its learning curve.SymfonyPropertyAccessorBridge refuses to touch private properties without accessors, which is a defensible default for contract integrity.Look elsewhere when:
spatie/laravel-data — switching costs exceed any gain from a 65-star dependency.To executives — one paragraph: This is a small, MIT-licensed Symfony bundle that standardizes how we convert internal objects into API and view models, replacing duplicated hand-written transformation code with declarative, testable configuration. Cost to trial is one Composer dependency and roughly a sprint of a single engineer's time; cost to reject is near zero. We should treat it as a timeboxed spike with explicit exit criteria, not a platform commitment — it has 65 stars, zero known dependents, and one maintainer, so it carries abandonment risk that we must own internally. Expected upside is reduced duplication and consistency in our API contracts; expected downside is bounded to the spike.
To engineering — the practical case: One service, automapper_plus.mapper, or just type-hint AutoMapperPlus\AutoMapperInterface. Register mappings in classes implementing AutoMapperConfiguratorInterface; with autowire/autoconfigure enabled the bundle tags them for you, and you can split profiles across as many configurators as you like with tag priorities. Options are configurable via config/packages/automapper_plus.yaml or set directly on the Options object in a configurator. The Symfony PropertyAccessor bridge gives strict-by-default behavior with a DecoratedPropertyAccessor escape hatch for private properties, and both enable nested fromProperty paths. The bundle tracks Symfony 3.4 through 8.x, so it will not block platform upgrades.
The ask: One sprint, one module, one owner. Deliverable is a benchmark (bulk mapping latency vs. hand-written), a mapping-assertion test pattern we can reuse, and a written recommendation. Decision gate before rollout: confirm stack fit, confirm the DTO layer is genuinely on the roadmap, and identify the profile owner. If any of those three fail, we stop and standardize on the incumbent — and we will have learned that cheaply.
How can I help you explore Laravel packages today?