Model Normalizer
With this package you can normalize objects to arrays.
Add FivePercent/ModelNormalizer in your composer.json:
{
"require": {
"fivepercent/model-normalizer": "~1.0"
}
}
Now tell composer to download the library by running the command:
$ php composer.phar update fivepercent/model-normalizer