diff --git a/src/Extend/Relationship.php b/src/Extend/Relationship.php index 895901f42..de16a6724 100644 --- a/src/Extend/Relationship.php +++ b/src/Extend/Relationship.php @@ -27,7 +27,7 @@ class Relationship implements ExtenderInterface $parent::addRelationship($this->name, function ($model) { if ($this->type instanceof Closure) { - return $this->type($model); + return call_user_func($this->type, $model); } elseif ($this->type === 'belongsTo') { return $model->belongsTo($this->child, null, null, $this->name); } else {