Skip to content

Commit 656b932

Browse files
committed
Fix accessor attributes not working on PHP < 8.1
1 parent afe3aa1 commit 656b932

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Console/ModelsCommand.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,9 @@ protected function hasCamelCaseModelProperties()
10961096

10971097
protected function getAttributeReturnType(Model $model, \ReflectionMethod $reflectionMethod): Collection
10981098
{
1099+
// Private/protected ReflectionMethods require setAccessible prior to PHP 8.1
1100+
$reflectionMethod->setAccessible(true);
1101+
10991102
/** @var Attribute $attribute */
11001103
$attribute = $reflectionMethod->invoke($model);
11011104

0 commit comments

Comments
 (0)