diff --git a/src/Models/ForeignRelationship.php b/src/Models/ForeignRelationship.php index 76ff840..2029853 100644 --- a/src/Models/ForeignRelationship.php +++ b/src/Models/ForeignRelationship.php @@ -27,6 +27,7 @@ class ForeignRelationship implements JsonWriter 'hasManyThrough', 'morphTo', 'morphMany', + 'morphOne', 'morphToMany', ]; @@ -107,6 +108,7 @@ public function isSingleRelation() return in_array($this->type, [ 'hasOne', 'belongsTo', + 'morphOne', 'morphTo', ]); } @@ -121,7 +123,7 @@ public function isSingleRelation() public function setType($type) { if (!self::isValidType($type)) { - throw new OutOfRangeException(); + throw new \OutOfRangeException(); } $this->type = $type;