@@ 235-242 (lines=8) @@ | ||
232 | * @param string|int|null $value |
|
233 | * @return array |
|
234 | */ |
|
235 | protected function dataWithAttributeValue(array $data, array $attributes, int $index, string $field, $value = null): array |
|
236 | { |
|
237 | if (array_key_exists($field, $attributes)) { |
|
238 | $data['records']['items'][$index][$field] = $value; |
|
239 | } |
|
240 | ||
241 | return $data; |
|
242 | } |
|
243 | ||
244 | /** |
|
245 | * Build the data array with each pivoted attribute<->value set for the given model. |
|
@@ 254-261 (lines=8) @@ | ||
251 | * @param string|int|null $value |
|
252 | * @return array |
|
253 | */ |
|
254 | protected function dataWithPivotAttributeValue(array $data, array $attributes, int $index, string $field, $value = null): array |
|
255 | { |
|
256 | if (array_key_exists($field, $attributes)) { |
|
257 | $data['pivots']['items'][$index][$field] = $value; |
|
258 | } |
|
259 | ||
260 | return $data; |
|
261 | } |
|
262 | ||
263 | /** |
|
264 | * Get the relations that should be revisionable alongside the original model. |