Skip to content

Commit c392fc2

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents e6b68b9 + 3753e4c commit c392fc2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Fields/Layouts.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function getFilledLayouts(): LayoutCollection
125125
);
126126
}
127127

128-
$filled = $values->map(function (LayoutItem $data) use ($layouts) {
128+
$filled = $values ? $values->map(function (LayoutItem $data) use ($layouts) {
129129
/** @var ?Layout $layout */
130130
$layout = $layouts->findByName($data->getName());
131131

@@ -168,7 +168,7 @@ public function getFilledLayouts(): LayoutCollection
168168
->headingAdditionalFields($fields);
169169

170170
return $layout->removeButton($this->getRemoveButton());
171-
})->filter();
171+
})->filter() : [];
172172

173173
return LayoutCollection::make($filled);
174174
}

tests/Feature/LayoutsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public function it_simple_create(): void
4444

4545
$model = TestModel::query()->first();
4646

47-
$first = static fn(TestModel $model): array => $model->data->findByName('first')->get('json');
48-
$second = static fn(TestModel $model): array => $model->data->findByName('second')->get('json');
47+
$first = static fn (TestModel $model): array => $model->data->findByName('first')->get('json');
48+
$second = static fn (TestModel $model): array => $model->data->findByName('second')->get('json');
4949

5050
$this->assertEquals(['key 1' => 'value 1', 'key 2' => 'value 2'], $first($model));
5151
$this->assertEquals([['title' => 'Title 1', 'image' => $image->hashName()]], $second($model));

0 commit comments

Comments
 (0)