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