Skip to content

Commit 1e09fa5

Browse files
authored
feat: support dynamically resolved relationships (#100)
1 parent 0b1b076 commit 1e09fa5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Laravel/EloquentResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected function getRelationshipValue(Model $model, Relationship $field, Conte
6767
{
6868
$method = $this->method($field);
6969

70-
if (method_exists($model, $method)) {
70+
if ($model->isRelation($method)) {
7171
$relation = $model->$method();
7272

7373
// If this is a belongs-to relationship, and we only need to get the ID

0 commit comments

Comments
 (0)