Skip to content

Commit

Permalink
Fixed recursive method forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
Radiergummi committed May 15, 2024
1 parent f3ab172 commit 91a7e23
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ public function __call(string $method, array $parameters): self
return $this->callNamedScope($method, $parameters);
}

if (!method_exists($this->getModel(), $method)) {
throw new BadMethodCallException(
"Method {$method} does not exist."
);
}

return $this->forwardCallTo(
$this->getModel(),
$method,
Expand Down

0 comments on commit 91a7e23

Please sign in to comment.