From 0645e9c65d512368af3b0861b5afe460caeadd26 Mon Sep 17 00:00:00 2001 From: Muath IbnHassan Date: Wed, 14 Oct 2020 14:58:02 +0300 Subject: [PATCH] fix pivot table naming bug --- src/Models/Model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Models/Model.php b/src/Models/Model.php index 36936289..3a4a86f8 100644 --- a/src/Models/Model.php +++ b/src/Models/Model.php @@ -155,7 +155,7 @@ public function addRelationship(string $type, string $reference) public function addPivotTable(string $reference) { - $segments = [$this->name(), $reference]; + $segments = [$this->name(), basename($reference)]; sort($segments); $this->pivotTables[] = $segments; } @@ -164,7 +164,7 @@ public function indexes(): array { return $this->indexes; } - + public function addIndex(Index $index) { $this->indexes[] = $index;