@@ -224,6 +224,7 @@ for Eloquent models. The relationship types available are `belongsTo`, `hasOne`,
224
224
| Eloquent | JSON API |
225
225
| :-- | :-- |
226
226
| ` hasOne ` | ` hasOne ` |
227
+ | ` hasOneThrough ` | ` hasOneThrough ` |
227
228
| ` belongsTo ` | ` belongsTo ` |
228
229
| ` hasMany ` | ` hasMany ` |
229
230
| ` belongsToMany ` | ` hasMany ` |
@@ -338,15 +339,16 @@ class Adapter extends AbstractAdapter
338
339
}
339
340
```
340
341
341
- #### Has-Many-Through
342
+ #### Has-One-Through and Has- Many-Through
342
343
343
- The JSON API ` hasManyThrough ` relation can be used for an Eloquent ` hasManyThrough ` relation. The important thing
344
- to note about this relationship is it is ** read-only** . This is because the relationship can be modified in your API
345
- by modifying the intermediary model. For example, a ` countries ` resource might have many ` posts ` resources through
346
- an intermediate ` users ` resource. The relationship is effectively modified by creating and deleting posts and/or a
347
- user changing which country they are associated to.
344
+ The JSON API ` hasOneThrough ` and ` hasManyThrough ` relations can be used for an Eloquent ` hasOneThrough `
345
+ and ` hasManyThrough ` relation. The important thing to note about these relationships is that both are ** read-only** .
346
+ This is because the relationship can be modified in your API by modifying the intermediary model.
347
+ For example, a ` countries ` resource might have many ` posts ` resources through an intermediate ` users ` resource.
348
+ The relationship is effectively modified by creating and deleting posts and/or a user changing which country they
349
+ are associated to.
348
350
349
- Define a has-many-through relationship on an adapter as follows:
351
+ Use the ` hasOneThrough() ` or ` hasManyThrough() ` methods on your adapter as follows:
350
352
351
353
``` php
352
354
class Adapter extends AbstractAdapter
0 commit comments