From 4337940fda72ac2c15ff2b03264195022c77e5fc Mon Sep 17 00:00:00 2001 From: Ievgen Antonovych <56879474+antevgen@users.noreply.github.com> Date: Fri, 12 Apr 2024 14:18:38 +0200 Subject: [PATCH] Update ReferenceFactory.php #227 --- src/Coders/Model/Relations/ReferenceFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Coders/Model/Relations/ReferenceFactory.php b/src/Coders/Model/Relations/ReferenceFactory.php index e0728245..6242fab2 100644 --- a/src/Coders/Model/Relations/ReferenceFactory.php +++ b/src/Coders/Model/Relations/ReferenceFactory.php @@ -73,7 +73,7 @@ protected function hasPivot() return false; } - $pivot = str_replace($firstRecord, '', $pivot); + $pivot = preg_replace("!$firstRecord!", '', $pivot, 1); foreach ($this->getRelatedBlueprint()->relations() as $reference) { if ($reference == $this->getRelatedReference()) {