From 583b11e707fcf227ab9fa6e91b6445eca1384cf4 Mon Sep 17 00:00:00 2001 From: PepperFM Date: Sun, 21 Jan 2024 18:14:33 +0300 Subject: [PATCH] [fix] getting attribute by named php agrument keyname --- src/Support/DataType.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Support/DataType.php b/src/Support/DataType.php index 45d268b64..1c94d25ed 100644 --- a/src/Support/DataType.php +++ b/src/Support/DataType.php @@ -244,7 +244,9 @@ protected function resolveDataCollectableClass( $attributes = $reflection->getAttributes(DataCollectionOf::class); if (! empty($attributes)) { - return $attributes[0]->getArguments()[0]; + $attributeArgumentKey = array_key_first($attributes[0]->getArguments()); + + return $attributes[0]->getArguments()[$attributeArgumentKey]; } if ($reflection instanceof ReflectionParameter) {