mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 16:23:16 +08:00
Fix incorrect function call
This commit is contained in:
parent
8f29679b46
commit
29be20c91a
|
@ -50,7 +50,7 @@ abstract class BaseSerializer extends SerializerAbstract
|
|||
$data = !is_null($model->$relation) ? $model->$relation : $model->$relation()->first();
|
||||
} elseif ($many) {
|
||||
$relationIds = $relation.'_ids';
|
||||
$data = $model->$relationIds ?: $model->relation()->get(['id'])->fetch('id')->all();
|
||||
$data = $model->$relationIds ?: $model->$relation()->get(['id'])->fetch('id')->all();
|
||||
} else {
|
||||
$relationId = $relation.'_id';
|
||||
$data = $model->$relationId;
|
||||
|
|
Loading…
Reference in New Issue
Block a user