Skip to content

Commit

Permalink
#36536 issue fix (#36801)
Browse files Browse the repository at this point in the history
The use of whereHasMorph in a whereHas callback generates a wrong sql statements. Correction of this incorrectly constructed statement has been applied.
  • Loading branch information
selcukcukur authored Mar 30, 2021
1 parent 8d22e03 commit 89d7683
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public function hasMorph($relation, $types, $operator = '>=', $count = 1, $boole
};
}

$query->where($this->query->from.'.'.$relation->getMorphType(), '=', (new $type)->getMorphClass())
$query->where($this->qualifyColumn($relation->getMorphType()), '=', (new $type)->getMorphClass())
->whereHas($belongsTo, $callback, $operator, $count);
});
}
Expand Down

0 comments on commit 89d7683

Please sign in to comment.