Skip to content

Commit a9a1d52

Browse files
committed
Fix use of make and position is in the wrong place
1 parent e782fdf commit a9a1d52

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Repositories/Behaviors/HandleRevisions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ public function hydrateRelatedBrowsers(TwillModelContract $object, array $fields
158158
foreach ($relatedBrowsers as $browser) {
159159
$browserField = $fields['browsers'][$browser['browserName']] ?? [];
160160

161+
$position = 1;
161162
foreach ($browserField as $values) {
162-
$position = 1;
163163

164-
$relatedBrowserItems->push(RelatedItem::make([
164+
$relatedBrowserItems->push(new RelatedItem([
165165
'subject_id' => $object->getKey(),
166166
'subject_type' => $object->getMorphClass(),
167167
'related_id' => $values['id'],

src/Repositories/BlockRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function hydrate(TwillModelContract $model, array $fields): TwillModelCon
3535
{
3636
$relatedItems = collect($fields['browsers'])
3737
->flatMap(fn($items, $browserName) => collect($items)
38-
->map(fn($item, $position) => RelatedItem::make([
38+
->map(fn($item, $position) => new RelatedItem([
3939
'subject_id' => $model->getKey(),
4040
'subject_type' => $model->getMorphClass(),
4141
'related_id' => $item['id'],

0 commit comments

Comments
 (0)