Skip to content

Commit 966a1bf

Browse files
committed
Merge branch 'main' into dev
2 parents a4fb675 + e1d4b8d commit 966a1bf

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [Unreleased]
88

9+
## [1.1.2] - 2025-06-11
10+
11+
### Fixed
12+
13+
- Fix formatting composite keys.
14+
915
## [1.1.1] - 2025-05-15
1016

1117
### Fixed
@@ -354,6 +360,7 @@ _Stable release based on [0.1.0-rc.1]._
354360
- New changelog file.
355361

356362
[Unreleased]: https://https://github.com/internetguru/laravel-model-browser/compare/staging...dev
363+
[1.1.2]: https://https://github.com/internetguru/laravel-model-browser/compare/v1.1.1...v1.1.2
357364
[1.1.1]: https://https://github.com/internetguru/laravel-model-browser/compare/v1.1.0...v1.1.1
358365
[1.1.0]: https://https://github.com/internetguru/laravel-model-browser/compare/v1.0.3...v1.1.0
359366
[1.1.0-rc.1]: https://github.com/internetguru/laravel-model-browser/releases/tag/v1.0.3

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)