- Does jolicode/automapper-bundle work with Laravel?
- No. It is a Symfony bundle built around Symfony's DI container, bundle class, compiler passes, and Config component, so it does not register a Laravel service provider or integrate with Illuminate\Container. The underlying jolicode/automapper library is framework-agnostic and can be wired manually in Laravel, but the bundle itself adds no Laravel value.
- How do I install jolicode/automapper-bundle in a Laravel application?
- Composer may install the package, but there is no Laravel service provider, configuration merge, or autowiring path, so the bundle will not boot or configure itself in Laravel. You would have to bypass the bundle and use the core jolicode/automapper library with a custom service provider. For most Laravel apps a native DTO or resource layer is a better fit.
- Which Laravel versions does jolicode/automapper-bundle support?
- None officially. The package declares Symfony framework integration and does not list Laravel version constraints or Laravel-specific compatibility. Its release 8.1.0 only updates the AutoMapper dependency floor, not framework support.
- Can I use the jolicode/automapper core library in Laravel without the bundle?
- Yes. The core library is framework-agnostic and can be bound into Laravel's container through your own service provider. You will need to configure mapping metadata, custom transformers, and caching manually. Evaluate whether the reflection overhead and maintenance risk justify it over Laravel-native options.
- What are the best Laravel alternatives to jolicode/automapper-bundle for DTO mapping?
- Common choices include spatie/laravel-data for rich DTOs, Eloquent API Resources for response shaping, and hand-written hydrators or mappers for smaller surfaces. These integrate with Laravel's container, validation, and request lifecycle without importing Symfony bundle concepts. Choose based on whether you need attribute-based mapping, validation, or simple array transformation.
- Is jolicode/automapper-bundle production-ready and actively maintained?
- A recent 8.1.0 release exists, but public evidence of maintenance is thin: a long quiet period, limited recent commits, and single-maintainer concentration are open questions. The dependency constraint on AutoMapper is expressed as a floor of >=8.2 with no visible upper bound, so a future major could be installed untested. Verify repository state and release cadence directly before relying on it.
- How do I configure mappings and custom transformers without Symfony?
- The bundle's configuration is Symfony-specific: bundle config, services.yaml, and compiler passes. Outside Symfony you configure the core library directly using its attributes, mapping definitions, and custom transformer classes. In Laravel you would register those services yourself and avoid the bundle's config layer entirely.
- Does jolicode/automapper-bundle support Laravel autowiring and dependency injection?
- No. It is designed to wire the mapper into Symfony's service container and relies on Symfony autowiring and bundle extension mechanics. Laravel's Illuminate\Container autowiring does not understand Symfony bundle classes or compiler passes. You would need a custom Laravel service provider around the core library.
- What is the performance impact of using AutoMapper in a Laravel request?
- AutoMapper relies on reflection and attribute parsing to build mapping metadata, so per-request overhead depends on how many mappings you invoke and whether metadata caching is enabled. The bundle does not provide a Laravel-specific cache warmer; you would need to measure with your own setup. For high-throughput APIs, benchmark against simple array or resource transformations.
- Should I choose jolicode/automapper-bundle or spatie/laravel-data for a Laravel project?
- For Laravel projects, spatie/laravel-data is the more natural fit because it integrates with Eloquent, validation, and Laravel's container out of the box. jolicode/automapper-bundle is a Symfony bundle and is out of scope for Laravel; even its core library requires manual wiring. Use the bundle only if you are working in Symfony or have a specific cross-framework mapping requirement.