Issues (7)

src/macros/joinRelation.php (1 issue)

1
<?php
2
3
use Illuminate\Database\Eloquent\Builder;
4
5
Builder::macro('joinRelation', function (string $relationName, $operator = '=') {
6
    $relation = $this->getRelation($relationName);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $this seems to be never defined.
Loading history...
7
8
    return $this->join(
9
        $relation->getRelated()->getTable(),
10
        $relation->getQualifiedForeignKeyName(),
11
        $operator,
12
        $relation->getQualifiedOwnerKeyName()
13
    );
14
});
15