Skip to content

Commit 0370e82

Browse files
author
Alex Barrett
committed
Reject static methods when searching for model relationships
1 parent de3b7d5 commit 0370e82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/RelationFinder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function getModelRelations(string $model)
3131
$methods = Collection::make($class->getMethods(ReflectionMethod::IS_PUBLIC))
3232
->merge($traitMethods)
3333
->reject(function (ReflectionMethod $method) use ($model) {
34-
return $method->class !== $model || $method->getNumberOfParameters() > 0;
34+
return $method->class !== $model || $method->getNumberOfParameters() > 0 || $method->isStatic();;
3535
});
3636

3737
$relations = Collection::make();

0 commit comments

Comments
 (0)