@@ -330,12 +330,12 @@ protected function updateData($record, array $document): array
330
330
$ resource ['attributes ' ] = $ this ->extractAttributes (
331
331
$ record ,
332
332
$ resource ['attributes ' ] ?? []
333
- )-> all () ;
333
+ );
334
334
335
335
$ resource ['relationships ' ] = $ this ->extractRelationships (
336
336
$ record ,
337
337
$ resource ['relationships ' ] ?? []
338
- )-> all () ;
338
+ );
339
339
}
340
340
341
341
return $ resource ;
@@ -363,34 +363,34 @@ protected function mustValidateExisting($record, array $document): bool
363
363
*
364
364
* @param $record
365
365
* @param array $new
366
- * @return Collection
366
+ * @return array
367
367
*/
368
- protected function extractAttributes ($ record , array $ new ): Collection
368
+ protected function extractAttributes ($ record , array $ new ): array
369
369
{
370
- return $ this ->existingAttributes ($ record )->merge ($ new );
370
+ return collect ( $ this ->existingAttributes ($ record )) ->merge ($ new)-> all ( );
371
371
}
372
372
373
373
/**
374
374
* Get any existing attributes for the provided record.
375
375
*
376
376
* @param $record
377
- * @return Collection
377
+ * @return iterable
378
378
*/
379
- protected function existingAttributes ($ record ): Collection
379
+ protected function existingAttributes ($ record ): iterable
380
380
{
381
- return collect ( $ this ->container ->getSchema ($ record )->getAttributes ($ record) );
381
+ return $ this ->container ->getSchema ($ record )->getAttributes ($ record );
382
382
}
383
383
384
384
/**
385
385
* Extract relationships for a resource update.
386
386
*
387
387
* @param $record
388
388
* @param array $new
389
- * @return Collection
389
+ * @return array
390
390
*/
391
- protected function extractRelationships ($ record , array $ new ): Collection
391
+ protected function extractRelationships ($ record , array $ new ): array
392
392
{
393
- return $ this ->existingRelationships ($ record )->merge ($ new );
393
+ return collect ( $ this ->existingRelationships ($ record )) ->merge ($ new)-> all ( );
394
394
}
395
395
396
396
/**
@@ -401,11 +401,11 @@ protected function extractRelationships($record, array $new): Collection
401
401
* to add existing relationship data.
402
402
*
403
403
* @param $record
404
- * @return Collection
404
+ * @return iterable
405
405
*/
406
- protected function existingRelationships ($ record ): Collection
406
+ protected function existingRelationships ($ record ): iterable
407
407
{
408
- return collect () ;
408
+ return [] ;
409
409
}
410
410
411
411
/**
0 commit comments