New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

json-mapper/laravel-package

The JsonMapper package for Laravel
236,494 25
Install
composer require json-mapper/laravel-package
Latest Version:3.0.0
PHP:^7.4 || ^8.0
Laravel:8 – 13
Older releases:5 · 6 · 7
License:MIT
Last Updated:Apr 5, 2026
Links: GitHub  ·  Packagist
Maintainer: danny.vandersluijs
JsonMapper logo

This is a Laravel package for using JsonMapper in you Laravel application.

JsonMapper is a PHP library that allows you to map a JSON response to your PHP objects that are either annotated using doc blocks or use typed properties. For more information see the project website: https://jsonmapper.net

GitHub Packagist Version PHP from Packagist Build Coverage Status

Why use JsonMapper

Continuously mapping your JSON responses to your own objects becomes tedious and is error prone. Not mentioning the tests that needs to be written for said mapping.

JsonMapper has been build with the most common usages in mind. In order to allow for those edge cases which are not supported by default, it can easily be extended as its core has been designed using middleware.

JsonMapper supports the following features

  • Case conversion
  • Debugging
  • DocBlock annotations
  • Final callback
  • Namespace resolving
  • PHP 7.4 Types properties

Installing JsonMapper laravel package

The installation of JsonMapper Laravel package can easily be done with Composer

$ composer require json-mapper/laravel-package

The example shown above assumes that composer is on your $PATH.

Contributing

Please refer to CONTRIBUTING.md for information on how to contribute to JsonMapper Laravel package.

List of Contributors

Thanks to everyone who has contributed to JsonMapper Laravel package! You can find a detailed list of people who contributed to JsonMapper on GitHub.

License

The MIT License (MIT). Please see License File for more information.

Related Packages

softonic/laravel-request-accept-json-middleware

Laravel middleware to add Accept application/json header to requests

57,290 4
open-cetacean/laravel-json-header

Middleware to force Laravel API group to JSON header

757 0
nutgram/hydrator

Hydrator for PHP 8.0+

486,300 11
jfadich/json-property

Transform an object property into an enhanced array

458 3

Version History

Version Released PHP Laravel License
3.0.0 ^7.4 || ^8.0 ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0 MIT
2.6.0 ^7.2 || ^8.0 ^5.5|^6|^7|^8|^9|^10 || ^11.0 || ^12.0 MIT
2.5.0 ^7.2 || ^8.0 ^5.5|^6|^7|^8|^9|^10 || ^11.0 MIT
2.4.0 ^7.2 || ^8.0 ^5.5|^6|^7|^8|^9|^10 MIT
2.3.0 ^7.2 || ^8.0 ^5.5|^6|^7|^8|^9 MIT