diff --git a/app/Models/ParkingSpaceAttributes.php b/app/Models/ParkingSpaceAttributes.php index 64b229b..9c29430 100644 --- a/app/Models/ParkingSpaceAttributes.php +++ b/app/Models/ParkingSpaceAttributes.php @@ -36,9 +36,10 @@ class ParkingSpaceAttributes extends Model public static function getTypeList(): array { - return self::query()->where('is_default', 0)->get()->select( + $data = self::query()->where('is_default', 0)->get()->select( ['id', 'attributes'] - )->each(function ($item) { + )->toArray(); + foreach ($data as &$item) { $item['attributes'] = AdminTranslationService::getTranslationTypeName( $item['id'], @@ -46,7 +47,8 @@ class ParkingSpaceAttributes extends Model $item['attributes'] ); return $item; - })->toArray(); + } + return $data; } public static function getAttr($id)