Suppose I have these responses from an API: - A Chat ```json { "id": "some-chat-id", "name": "Some chat name" } ``` - And a chat item (a message) ```json { "id": "some-chat-item-id", "name": "Some chat item name", "chatId": "some-chat-id" } ``` I want to model it using a `HasMany` and `BelongsTo` but I don't have any idea how to do it. How should I map chat `chatId` to `Chat` using the framework ?
Suppose I have these responses from an API:
A Chat
{ "id": "some-chat-id", "name": "Some chat name" }And a chat item (a message)
{ "id": "some-chat-item-id", "name": "Some chat item name", "chatId": "some-chat-id" }I want to model it using a
HasManyandBelongsTobut I don't have any idea how to do it. How should I map chatchatIdtoChatusing the framework ?