From f50470ba493db80227450553fa0453987e951cae Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Wed, 2 Mar 2016 10:54:41 +0100 Subject: [PATCH] Add morphOne, fix morphTo Fixes #236 thanks to @boxfrommars --- src/Console/ModelsCommand.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index d0bd892..aa3bf46 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -356,6 +356,7 @@ class ModelsCommand extends Command 'belongsToMany', 'hasOne', 'belongsTo', + 'morphOne', 'morphTo', 'morphMany', 'morphToMany' @@ -377,6 +378,9 @@ class ModelsCommand extends Command true, null ); + } elseif ($relation === "morphTo") { + // Model isn't specified because relation is polymorphic + $this->setProperty($method, '\Illuminate\Database\Eloquent\Model|\Eloquent', true, null); } else { //Single model is returned $this->setProperty($method, $relatedModel, true, null);