Merge pull request #212 from modder2/modder2-patch-1

Bug fix with model relations
This commit is contained in:
Barry vd. Heuvel
2015-05-15 12:26:15 +02:00
+1 -1
View File
@@ -345,7 +345,7 @@ class ModelsCommand extends Command
$search = '$this->' . $relation . '(';
if ($pos = stripos($code, $search)) {
$code = substr($code, $pos + strlen($search));
$arguments = explode(',', substr($code, 0, strpos($code, ');')));
$arguments = explode(',', substr($code, 0, strpos($code, ')')));
//Remove quotes, ensure 1 \ in front of the model
$returnModel = $this->getClassName($arguments[0], $model);
if ($relation === "belongsToMany" or $relation === 'hasMany' or $relation === 'morphMany' or $relation === 'morphToMany') {