Skip to content

Commit 55b1668

Browse files
committed
Merge branch 'hotfix-petrzpav' into main-0
2 parents d9c6650 + f6e9944 commit 55b1668

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [0.12.2] - 2025-04-25
8+
9+
### Fixed
10+
11+
- Fix empty data.
12+
713
## [0.12.1] - 2025-04-25
814

915
### Fixed
@@ -300,6 +306,7 @@ _Stable release based on [0.1.0-rc.1]._
300306

301307
- New changelog file.
302308

309+
[0.12.2]: https://https://github.com/internetguru/laravel-model-browser/compare/v0.12.1...v0.12.2
303310
[0.12.1]: https://https://github.com/internetguru/laravel-model-browser/compare/v0.12.0...v0.12.1
304311
[0.12.0]: https://https://github.com/internetguru/laravel-model-browser/compare/v0.11.0...v0.12.0
305312
[0.12.0-rc.1]: https://github.com/internetguru/laravel-model-browser/releases/tag/v0.11.0

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.12.1
1+
0.12.2

src/Components/BaseModelBrowser.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,17 +166,17 @@ protected function getData(bool $paginate = true, bool $highlightMatches = true,
166166
? $this->model::{$this->modelMethod}()
167167
: $this->model::query()->get();
168168

169+
if ($data->count() === 0) {
170+
return $data;
171+
}
172+
169173
// Append missing attributes
170174
foreach ($this->viewAttributes as $attribute => $trans) {
171175
if (! isset($data[0]->{$attribute})) {
172176
$data[0]->{$attribute} = null;
173177
}
174178
}
175179

176-
if ($data->count() === 0) {
177-
return $data;
178-
}
179-
180180
if ($applyFormats) {
181181
$data = $this->format($data);
182182
}

0 commit comments

Comments
 (0)