Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Update BelongsToMorphedSchema.php
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy-j authored Jul 6, 2017
1 parent 7acdf0b commit 2e3125f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ public function declareTables(SchemaBuilder $builder): array

$outerKey = $this->findOuter($builder);
if (empty($outerKey)) {
throw new RelationSchemaException("Unable to build morphed relation, no outer record found");
throw new RelationSchemaException(sprintf(
"Unable to build morphed relation, no outer record(s) found for '%s' from '%s'",
$this->getDefinition()->getTarget(),
$this->getDefinition()->sourceContext()->getClass()
));
}

//Make sure all tables has same outer
Expand Down Expand Up @@ -198,4 +202,4 @@ public function packRelation(SchemaBuilder $builder): array

return $packed;
}
}
}

0 comments on commit 2e3125f

Please sign in to comment.