diff --git a/src/PowerJoinClause.php b/src/PowerJoinClause.php index 1d32dc1..bfc7c41 100644 --- a/src/PowerJoinClause.php +++ b/src/PowerJoinClause.php @@ -189,7 +189,11 @@ public function __call($name, $arguments) if (method_exists($this->getModel(), $scope)) { return $this->getModel()->{$scope}($this, ...$arguments); } else { - throw new InvalidArgumentException(sprintf('Method %s does not exist in PowerJoinClause class', $name)); + if (static::hasMacro($name)) { + return $this->macroCall($name, $arguments); + } else { + throw new InvalidArgumentException(sprintf('Method %s does not exist in PowerJoinClause class', $name)); + } } } }