Download the PHP package michael-rubel/laravel-model-mapper without Composer
On this page you can find all versions of the php package michael-rubel/laravel-model-mapper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download michael-rubel/laravel-model-mapper
More information about michael-rubel/laravel-model-mapper
Files in michael-rubel/laravel-model-mapper
Package laravel-model-mapper
Short Description Collection of functions to loop over your data.
License MIT
Homepage https://github.com/michael-rubel/laravel-loop-functions
Informations about the package laravel-model-mapper
Laravel Loop Functions
The package provides the collection of methods to loop over your data.
The package requires PHP 8
or higher and Laravel 9
or higher.
StandWithUkraine
Installation
Install the package using composer:
Usage
Assign Eloquent model attributes to class properties:
Assign array key values to class properties:
If you want to use dynamic properties, adjust the dynamic_properties
key in the config and add the following trait if your class is not already implementing the get/set
magic methods:
Note: if you use the Livewire components, it already has similar definitions under the hood.
Dump class properties:
Ignored property names
By default, the package ignores id
and password
properties to avoid conflicts in Livewire/auth components.
You can customize the ignore list by editing the config.
Logging
The functions don't throw an exception in case of failed assignment (e.g. type incompatibility) but log such an event. You can disable exception logging if you wish so in the config.
Testing
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-model-mapper with dependencies
illuminate/contracts Version ^9.0|^10.0
spatie/laravel-package-tools Version ^1.9