Skip to content

Commit 9736413

Browse files
committed
wip
1 parent 0d541f1 commit 9736413

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Mixins/RelationshipsExtraMethods.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
use Kirschbaum\PowerJoins\PowerJoinClause;
1313
use Kirschbaum\PowerJoins\PowerJoins;
1414

15+
/**
16+
* @method getModel
17+
*/
1518
class RelationshipsExtraMethods
1619
{
1720
/**
@@ -224,6 +227,10 @@ protected function performJoinForEloquentPowerJoinsForHasManyThrough()
224227
if (is_array($callback) && isset($callback[$this->getThroughParent()->getTable()])) {
225228
$callback[$this->getThroughParent()->getTable()]($join);
226229
}
230+
231+
if ($callback && is_callable($callback)) {
232+
$callback($join);
233+
}
227234
}, $this->getThroughParent());
228235

229236
$builder->{$joinType}($this->getModel()->getTable(), function (PowerJoinClause $join) use ($callback, $throughTable, $farTable, $alias1, $alias2) {

0 commit comments

Comments
 (0)