| 1 | <?php |
||
| 8 | trait UpdatesModelRelations |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * The model relationships that can be updated. |
||
| 12 | * |
||
| 13 | * @var array |
||
| 14 | */ |
||
| 15 | protected $fillableRelations = []; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Determine whether the given named relation can be updated on the model. |
||
| 19 | * |
||
| 20 | * @param string $relation |
||
| 21 | */ |
||
| 22 | protected function isFillableRelation($relation): bool |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Update one or more relationships on a model instance from an array of |
||
| 29 | * named relationships and associated resource identifiers. |
||
| 30 | * |
||
| 31 | * http://jsonapi.org/format/#crud-updating-resource-relationships |
||
| 32 | * |
||
| 33 | * @param Model $record |
||
| 34 | * @param array $relationships |
||
| 35 | */ |
||
| 36 | protected function updateResourceRelationships($record, array $relationships) |
||
| 51 | } |
||
| 52 |