Skip to content

Commit 89d7683

Browse files
authored
#36536 issue fix (#36801)
The use of whereHasMorph in a whereHas callback generates a wrong sql statements. Correction of this incorrectly constructed statement has been applied.
1 parent 8d22e03 commit 89d7683

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public function hasMorph($relation, $types, $operator = '>=', $count = 1, $boole
223223
};
224224
}
225225

226-
$query->where($this->query->from.'.'.$relation->getMorphType(), '=', (new $type)->getMorphClass())
226+
$query->where($this->qualifyColumn($relation->getMorphType()), '=', (new $type)->getMorphClass())
227227
->whereHas($belongsTo, $callback, $operator, $count);
228228
});
229229
}

0 commit comments

Comments
 (0)