jolicode/automapper
A fast, flexible object-to-object mapper for PHP inspired by .NET's AutoMapper. Map between objects, arrays, and scalars using attributes, with automatic type conversion, nested mappings, custom transformers, and zero-config defaults. Framework-agnostic, works great with Symfony.
toArray(), manual hydrators, and ad hoc transformation logic across controllers, jobs, and services.Consider it when:
Look elsewhere when:
spatie/laravel-data or native Resources first.For executives: This is a low-cost, MIT-licensed PHP mapper that can reduce boilerplate and inconsistency in API and integration work. It is best positioned as a targeted productivity tool: pilot it on a bounded mapping-heavy feature, measure delivery speed and defect reduction, and avoid making it a platform dependency until the team has validated operational fit.
For engineering: JoliCode AutoMapper generates mapping code on the fly, which can make DTO/entity/API transformations fast and explicit without hand-writing every mapper. In Laravel, integrate it through a service provider, keep generated code in a writable/cacheable path, and isolate it behind an internal mapping contract. The main trade-offs are modest ecosystem adoption, non-Laravel-specific documentation, and the need to own code-generation/deployment behavior. Use native Laravel Resources or spatie/laravel-data where they already fit; use this package where mapping volume and performance justify a dedicated mapper.
How can I help you explore Laravel packages today?