Skip to content

Commit 80d8864

Browse files
committed
Fix accessor attributes not working on PHP < 8.1
1 parent f119ba6 commit 80d8864

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
@@ -1137,6 +1137,9 @@ protected function hasCamelCaseModelProperties()
11371137

11381138
protected function getAttributeReturnType(Model $model, \ReflectionMethod $reflectionMethod): Collection
11391139
{
1140+
// Private/protected ReflectionMethods require setAccessible prior to PHP 8.1
1141+
$reflectionMethod->setAccessible(true);
1142+
11401143
/** @var Attribute $attribute */
11411144
$attribute = $reflectionMethod->invoke($model);
11421145

0 commit comments

Comments
 (0)