Skip to content

Commit 88b7653

Browse files
committed
Removed custom modelToArray function
1 parent 9968cb6 commit 88b7653

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/SimpleDTO.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,6 @@ private function formatArrayableValue(mixed $value): array|int|string
482482
$value instanceof UnitEnum => $value->name,
483483
$value instanceof Carbon || $value instanceof CarbonImmutable => $value->toISOString(true),
484484
$value instanceof Collection => $this->transformCollectionToArray($value),
485-
$value instanceof Model => $this->transformModelToArray($value),
486485
$value instanceof SimpleDTO => $this->transformDTOToArray($value),
487486
$value instanceof Arrayable => $value->toArray(),
488487
is_object($value) => (array) $value,
@@ -499,18 +498,6 @@ private function transformCollectionToArray(Collection $collection): array
499498
})->toArray();
500499
}
501500

502-
private function transformModelToArray(Model $model): array
503-
{
504-
$result = [];
505-
foreach ($model->getAttributes() as $key => $value) {
506-
$result[$key] = $this->isArrayable($value)
507-
? $this->formatArrayableValue($value)
508-
: $value;
509-
}
510-
511-
return $result;
512-
}
513-
514501
private function transformDTOToArray(SimpleDTO $dto): array
515502
{
516503
$result = [];

0 commit comments

Comments
 (0)