File tree Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Original file line number Diff line number Diff 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 ,
@@ -492,23 +491,9 @@ private function formatArrayableValue(mixed $value): array|int|string
492491
493492 private function transformCollectionToArray (Collection $ collection ): array
494493 {
495- return $ collection ->map (function ($ item ) {
496- return $ this ->isArrayable ($ item )
494+ return $ collection ->map (fn ($ item ) => $ this ->isArrayable ($ item )
497495 ? $ this ->formatArrayableValue ($ item )
498- : $ item ;
499- })->toArray ();
500- }
501-
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 ;
496+ : $ item )->toArray ();
512497 }
513498
514499 private function transformDTOToArray (SimpleDTO $ dto ): array
You can’t perform that action at this time.
0 commit comments