diff --git a/src/concerns/ModifyProperty.php b/src/concerns/ModifyProperty.php index cf75d03..83d9a4e 100644 --- a/src/concerns/ModifyProperty.php +++ b/src/concerns/ModifyProperty.php @@ -11,7 +11,9 @@ trait ModifyProperty $reflectObject = new ReflectionObject($object); if ($reflectObject->hasProperty($property)) { $reflectProperty = $reflectObject->getProperty($property); - $reflectProperty->setAccessible(true); + if(PHP_VERSION_ID < 80100) { + $reflectProperty->setAccessible(true); + } $reflectProperty->setValue($object, $value); } }