alariva / modelmerge
A Laravel package for Merging Eloquent Models
v0.4
2018-09-16 18:01 UTC
Requires
Requires (Dev)
- orchestra/testbench: ~3.5
- phpunit/phpunit: ~6.0
This package is auto-updated.
Last update: 2024-10-29 05:10:49 UTC
README
Easy merging for Eloquent Models.
Installation
Via Composer
$ composer require alariva/modelmerge
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
Please see the changelog for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email author email instead of using the issue tracker.
Credits
- Ariel Vallese
- Icons made by Freepik from Flaticon is licensed by CC 3.0 BY
- Icons made by Roundicons from Flaticon is licensed by CC 3.0 BY
License
MIT. Please see the license file for more information.