Мой файл API.
Код: Выделить всё
$server->resource('documents', JsonApiController::class)
->relationships(function ($relations) {
$relations->hasOne('documentable');
});
< /code>
Мои документы содержит это поле: < /p>
MorphTo::make("documentable")->types("trees", "maintenance-requests")->withUriFieldName('documentavel'),
< /code>
Моя модель документа содержит эту связь: < /p>
public function documentable(): MorphTo
{
return $this->morphTo();
}
Код: Выделить всё
"detail": "No schema for JSON:API resource type documentables.",
Что я у меня Делаешь неправильно? Я попытался добавить другие поля, представляющие эти отношения, попытался изучить внутренние внутренности Laravel-json-API, но, к сожалению, я застрял в этой ошибке уже 3 дня
Подробнее здесь: https://stackoverflow.com/questions/792 ... lationship