apimatic/jsonmapper
apimatic/jsonmapper is a lightweight PHP JSON-to-object mapper for converting API responses into typed models. It maps arrays/JSON to class properties with minimal setup, supports nested structures, and helps keep data hydration consistent across your application.
Architecture fit: Ideal for DTO hydration in Laravel service layers or SDK development, complementing Eloquent by handling raw API responses. Fits naturally in HTTP clients or service classes where JSON responses need structured object mapping. Does not integrate with Eloquent models directly but excels in stateless data transformation layers.
Integration feasibility: High. Composer-based installation with zero Laravel-specific dependencies. Works directly with json_decode() outputs (stdClass/arrays), requiring minimal code changes. Laravel's dependency injection supports seamless class instantiation.
Technical risk: Low adoption (24 stars) raises maintenance concerns; potential for unaddressed edge cases. License (OSL-3.0) is permissive but requires source disclosure if distributed—acceptable for internal use but requires legal review for public SDKs. Suspicious "2025-11-06" release date suggests possible data inaccuracies or abandonment.
Key questions:
DateTimeInterface)?Stack fit: Best suited for API client services (e.g., external service integrations) or SDKs within Laravel. Avoids Eloquent models but aligns with CQRS or clean architecture patterns where DTOs decouple data from persistence.
Migration path:
composer require apimatic/jsonmapperstring, int, array, or nested DTOs)json_decode() + manual property assignment with JsonMapper->map($json, new MyDto())How can I help you explore Laravel packages today?