@galironfydar this works.
$values = [];
foreach ($response->parameter as $parameter) {
foreach ($parameter->part as $part) {
if ($part->name == 'documentIdentifier') {
$name = $part->valueString;
}
if ($part->name == 'read') {
$value = $part->valueBoolean;
}
}
if (isset($name) && isset($value)) {
$values[$name] = $value;
}
}
its a bit more robust that what you've got. Could probably be improved again if I can remember how to do it without collections :P
BTW if you did want to use collections but not use Laravel, you can just pull in the package https://github.com/tighten/collect