From ac927243648c23eb66a3824496f0ba92aa761f14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sun, 16 Jan 2022 16:19:07 +0100 Subject: [PATCH] fix stan --- src/Model/Join.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/Model/Join.php b/src/Model/Join.php index 9c1ce50635..916f30c29f 100644 --- a/src/Model/Join.php +++ b/src/Model/Join.php @@ -155,18 +155,12 @@ protected function createFakeForeignModel(): Model public function getForeignModel(): Model { - if (is_string($this->foreign_table)) { - // TODO this should be removed in the future - if (!isset($this->getOwner()->with[$this->foreign_table])) { - return $this->createFakeForeignModel(); - } - - return $this->getOwner()->with[$this->foreign_table]['model']; + // TODO this should be removed in the future + if (!isset($this->getOwner()->with[$this->foreign_table])) { + return $this->createFakeForeignModel(); } - $this->foreign_table->assertIsModel(); - - return $this->foreign_table; + return $this->getOwner()->with[$this->foreign_table]['model']; } /**