Skip to content

Commit

Permalink
Update JoinRelationTrait.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris Kremenovic authored Apr 26, 2019
1 parent b9cf8cf commit c804181
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Traits/JoinRelationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Fico7489\Laravel\EloquentJoin\Traits;

use Fico7489\Laravel\EloquentJoin\EloquentJoinBuilder;

trait JoinRelationTrait
{
/**
Expand All @@ -14,7 +16,9 @@ trait JoinRelationTrait
*/
public function __call($method, $parameters)
{
$this->getQuery()->relationClauses[] = [$method => $parameters];
if ($this->getQuery() instanceof EloquentJoinBuilder) {
$this->getQuery()->relationClauses[] = [$method => $parameters];
}

return parent::__call($method, $parameters);
}
Expand Down

0 comments on commit c804181

Please sign in to comment.