PHPackages                             alariva/modelmerge - 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. [Database &amp; ORM](/categories/database)
4. /
5. alariva/modelmerge

ActiveLibrary[Database &amp; ORM](/categories/database)

alariva/modelmerge
==================

A Laravel package for Merging Eloquent Models

v0.4(7y ago)164255[6 PRs](https://github.com/alariva/laravel-modelmerge/pulls)MITPHP

Since Sep 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/alariva/laravel-modelmerge)[ Packagist](https://packagist.org/packages/alariva/modelmerge)[ Docs](https://github.com/alariva/laravel-modelmerge)[ RSS](/packages/alariva-modelmerge/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (4)Versions (9)Used By (0)

ModelMerge Laravel package
==========================

[](#modelmerge-laravel-package)

[![Latest Stable Version](https://camo.githubusercontent.com/245658cf13d34c78ae16c054f259baab03425bd68a5457a7b82d8a007ef53216/68747470733a2f2f706f7365722e707567782e6f72672f616c61726976612f6d6f64656c6d657267652f762f737461626c653f666f726d61743d666c6174)](https://packagist.org/packages/alariva/modelmerge)[![Total Downloads](https://camo.githubusercontent.com/ad58a098a89227ce1bab2ef4319851e838f9279098458f25bdeba86ea22edced/68747470733a2f2f706f7365722e707567782e6f72672f616c61726976612f6d6f64656c6d657267652f646f776e6c6f6164733f666f726d61743d666c6174)](https://packagist.org/packages/alariva/modelmerge)[![Latest Unstable Version](https://camo.githubusercontent.com/0c2d9e6ed0b38635be9d10ba6f984b2d472f4502b54af40887ad270f19cb7497/68747470733a2f2f706f7365722e707567782e6f72672f616c61726976612f6d6f64656c6d657267652f762f756e737461626c653f666f726d61743d666c6174)](https://packagist.org/packages/alariva/modelmerge)[![Build Status](https://camo.githubusercontent.com/7000f7a7743544f97dadc307b5f61160b10819841aab7d6d477c1d3243fb8530/68747470733a2f2f7472617669732d63692e6f72672f616c61726976612f6c61726176656c2d6d6f64656c6d657267652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/alariva/laravel-modelmerge)[![Maintainability](https://camo.githubusercontent.com/d80dab17bcb83ffd45fd53bdaf87834930ae55727d9aafdaf3d02acc20cb7523/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f66383832396161623266373837653430336433652f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/alariva/laravel-modelmerge/maintainability)[![Test Coverage](https://camo.githubusercontent.com/92903045ade9a1d032f194bbef49e1416bff6ba9f387c4974ee0bb7d70e0229b/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f66383832396161623266373837653430336433652f746573745f636f766572616765)](https://codeclimate.com/github/alariva/laravel-modelmerge/test_coverage)[![License](https://camo.githubusercontent.com/6bd4ae67df387fe74877271eec93264a90fcc13eb8a9bc45a4ef7a9aa5099a9b/68747470733a2f2f706f7365722e707567782e6f72672f616c61726976612f6d6f64656c6d657267652f6c6963656e73653f666f726d61743d666c6174)](https://packagist.org/packages/alariva/modelmerge)[![FOSSA Status](https://camo.githubusercontent.com/6f0fac7876bd8e9f2b9da98e238cdac5e4d7e3c2cdee635134cbcb67d31e4de9/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246616c61726976612532466c61726176656c2d6d6f64656c6d657267652e7376673f747970653d736869656c64)](https://app.fossa.io/projects/git%2Bgithub.com%2Falariva%2Flaravel-modelmerge?ref=badge_shield)

Easy merging for Eloquent Models.

[![](https://camo.githubusercontent.com/07c85a79aab189613e426dc102a4f6698b3207a3d647737426a926ec4b34cb30/68747470733a2f2f692e696d6775722e636f6d2f695430764c53432e706e67)](https://camo.githubusercontent.com/07c85a79aab189613e426dc102a4f6698b3207a3d647737426a926ec4b34cb30/68747470733a2f2f692e696d6775722e636f6d2f695430764c53432e706e67)

Installation
------------

[](#installation)

Via Composer

```
$ composer require alariva/modelmerge
```

Usage
-----

[](#usage)

```
    $modelA = SampleModel::make(['firstname' => 'John', 'age' => 33]);
    $modelB = SampleModel::make(['firstname' => 'John', 'lastname' => 'Doe']);

    $mergedModel = ModelMerge::setModelA($modelA)->setModelB($modelB)->merge();

    $mergedModel->firstname; // John
    $mergedModel->lastname; // Doe
    $mergedModel->age; // 33
```

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Security
--------

[](#security)

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits
-------

[](#credits)

- [Ariel Vallese](https://alariva.com)
- Icons made by [Freepik](http://www.freepik.com) from [Flaticon](http://www.flaticon.com) is licensed by [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/)
- Icons made by [Roundicons](https://www.flaticon.com/authors/roundicons) from [Flaticon](http://www.flaticon.com) is licensed by [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/)

License
-------

[](#license)

MIT. Please see the [license file](license.md) for more information.

[![FOSSA Status](https://camo.githubusercontent.com/2acfd3132a2b10dd4c52e1791bb3e0f19903374c94b34dfd6c79507dd50443f7/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246616c61726976612532466c61726176656c2d6d6f64656c6d657267652e7376673f747970653d6c61726765)](https://app.fossa.io/projects/git%2Bgithub.com%2Falariva%2Flaravel-modelmerge?ref=badge_large)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.8% 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 ~2 days

Total

4

Last Release

2793d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d0ae4753838afbfd34e573e3a73c3f69c02a31de0c477cffae908408dc30e590?d=identicon)[alariva](/maintainers/alariva)

---

Top Contributors

[![alariva](https://avatars.githubusercontent.com/u/3021314?v=4)](https://github.com/alariva "alariva (30 commits)")[![fossabot](https://avatars.githubusercontent.com/u/29791463?v=4)](https://github.com/fossabot "fossabot (1 commits)")

---

Tags

eloquenteloquent-modelslaravellaravel-5-packagelaravel-packagemergephpphp7laravelModelMerge

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alariva-modelmerge/health.svg)

```
[![Health](https://phpackages.com/badges/alariva-modelmerge/health.svg)](https://phpackages.com/packages/alariva-modelmerge)
```

###  Alternatives

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8703.0M17](/packages/yajra-laravel-oci8)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)

PHPackages © 2026

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