From 3c1af9b86b02f1e39219849c1d2fee7cf77e8638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20JEAN?= Date: Tue, 26 Nov 2024 14:22:08 +0100 Subject: [PATCH] Add extra condition to avoid wrong on clause on MorphTo joins, closes #191 (#192) --- src/Mixins/RelationshipsExtraMethods.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mixins/RelationshipsExtraMethods.php b/src/Mixins/RelationshipsExtraMethods.php index f697e8e..e40ffe0 100644 --- a/src/Mixins/RelationshipsExtraMethods.php +++ b/src/Mixins/RelationshipsExtraMethods.php @@ -530,7 +530,7 @@ public function applyNestedCondition() public function shouldNotApplyExtraCondition() { return function ($condition) { - if (isset($condition['column']) && Str::endsWith($condition['column'], '.')) { + if (isset($condition['column']) && ($condition['column'] === '' || Str::endsWith($condition['column'], '.'))) { return true; }