Skip to content

Commit f7408ec

Browse files
committed
wip
1 parent 6659947 commit f7408ec

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/PowerJoinClause.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,16 @@ public function joinType(string $joinType): self
283283

284284
public function __call($name, $arguments)
285285
{
286-
if (!$this->getModel()) {
286+
if (! $this->getModel()) {
287287
return;
288288
}
289289

290-
if ($this->hasLaravelScopeAttribute($name) || method_exists($this->getModel(), 'scope'.ucfirst($name))) {
290+
if (method_exists($this->getModel(), 'scope'.ucfirst($name))) {
291+
$scope = 'scope'.ucfirst($name);
292+
return $this->getModel()->{$scope}($this, ...$arguments);
293+
}
294+
295+
if ($this->hasLaravelScopeAttribute($name)) {
291296
return $this->getModel()->callNamedScope($name, array_merge([$this], $arguments));
292297
}
293298

0 commit comments

Comments
 (0)