We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c3b9bed + 0528150 commit d90bfaeCopy full SHA for d90bfae
src/EloquentDataTable.php
@@ -134,7 +134,8 @@ protected function isMorphRelation($relation)
134
if ($relation !== null && $relation !== '') {
135
$relationParts = explode('.', $relation);
136
$firstRelation = array_shift($relationParts);
137
- $isMorph = $this->query->getModel()->$firstRelation() instanceof MorphTo;
+ $model = $this->query->getModel();
138
+ $isMorph = method_exists($model, $firstRelation) && $model->$firstRelation() instanceof MorphTo;
139
}
140
141
return $isMorph;
0 commit comments