PHPackages                             mennen-online/laravel-response-models - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mennen-online/laravel-response-models

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mennen-online/laravel-response-models
=====================================

Convert Http JSON Responses in standard JSON Format

2.1.1(6mo ago)15.9k3PHPPHP ^8.0

Since Feb 22Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/mennen-online/laravel-response-models)[ Packagist](https://packagist.org/packages/mennen-online/laravel-response-models)[ RSS](/packages/mennen-online-laravel-response-models/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (2)Versions (8)Used By (3)

Laravel Httpclient Response Model
=================================

[](#laravel-httpclient-response-model)

This package offers a Base Model, which can be extended with Data Models to map HTTP Responses.

It is not only bound / limited to Laravels Http Client, so you can use ist with any JSON Response you want.

Installation
============

[](#installation)

You can install the package via composer:

```
composer require mennen-online/laravel-response-models
```

Usage
=====

[](#usage)

Here's a little example how to create Response Models with this Package:

```
use MennenOnline\LaravelResponseModels\Models\BaseModel;

class PersonContact extends BaseModel {
    protected array $fieldMap = [
        'roles.customer.number' => 'customer_number',
        'roles.vendor.number' => 'vendor_number',
        'person' => [
            'first_name' => 'person_first_name',
            'last_name' => 'person_last_name'
        ]
    ];
}
```

Now you have defined the Response Model for PersonContact

[Example Lexoffice Contact Response used for this](https://developers.lexoffice.io/docs/#contacts-endpoint-create-a-contact)

Now we make a Request to Lexoffice API:

We can use the Response to create the ResponseModel:

```
 use Illuminate\Support\Facades\Http;

$response = Http::get('https://api.lexoffice.io/v1/contacts/2a730f45-8078-3ccc-a2ed-563f18208eff');

$personContact = new PersonContact($response->object());
```

Now we can access the Properties on the Top Level as Properties, every other property as Array:

```
$personContact->version // 1

$personContact->customer_number // 12345

$personContact->__get('person.first_name') // Verena
```

And so on.

Also nested Arrays are automatically converted to snake\_case - Accessible with Arr::get for example.

Features
========

[](#features)

Inspired of Laravel Models, it is currently possible to:

- Define getter and setter (set{AttributeName}Attribute | get{AttributeName}Attribute)

Testing
=======

[](#testing)

```
composer test
```

License
=======

[](#license)

The MIT License (MIT).

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance66

Regular maintenance activity

Popularity24

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~221 days

Recently: every ~306 days

Total

7

Last Release

208d ago

Major Versions

1.1.1 → 2.0.02022-07-22

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/77828605?v=4)[Hendrik Mennen](/maintainers/hmennen90)[@hmennen90](https://github.com/hmennen90)

---

Top Contributors

[![hmennen90](https://avatars.githubusercontent.com/u/77828605?v=4)](https://github.com/hmennen90 "hmennen90 (10 commits)")

### Embed Badge

![Health badge](/badges/mennen-online-laravel-response-models/health.svg)

```
[![Health](https://phpackages.com/badges/mennen-online-laravel-response-models/health.svg)](https://phpackages.com/packages/mennen-online-laravel-response-models)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
