Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-to committed Aug 23, 2024
2 parents e6b68b9 + 3753e4c commit c392fc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Fields/Layouts.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function getFilledLayouts(): LayoutCollection
);
}

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

Expand Down Expand Up @@ -168,7 +168,7 @@ public function getFilledLayouts(): LayoutCollection
->headingAdditionalFields($fields);

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

return LayoutCollection::make($filled);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/LayoutsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public function it_simple_create(): void

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

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

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

0 comments on commit c392fc2

Please sign in to comment.