Skip to content

Commit 2acac81

Browse files
committed
Fix formatting composite keys
1 parent d234a99 commit 2acac81

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Components/BaseModelBrowser.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,11 @@ protected function format($data)
259259
{
260260
$data->transform(function ($item) {
261261
foreach ($this->formats as $attribute => $format) {
262-
if (! isset($item->{$attribute})) {
262+
$value = Arr::get($item, $attribute);
263+
if ($value === null) {
263264
continue;
264265
}
265-
$item->{$attribute . 'Formatted'} = $format($item->{$attribute}, $item);
266+
$item->{$attribute . 'Formatted'} = $format($value, $item);
266267
}
267268

268269
return $item;

0 commit comments

Comments
 (0)