statamic-rad-pack / runway

Eloquently manage your database models in Statamic.
https://statamic.com/runway
MIT License
107 stars 43 forks source link

[6.x] Wrap values when getting augmentable models #440

Closed duncanmcclean closed 4 months ago

duncanmcclean commented 4 months ago

This pull request fixes an issue where $values was an Eloquent Model instance. However, when it was being converted into a Illuminate Collection, it ended up turning into an array like this:

[
  'id' => 1,
  'name' => 'John Doe',
  'email' => 'john.doe@example.com',
  'data' => ['foo' => 'bar']
]

This array was then passed in as separate items into the ->map which ended up causing issues. By adding an Arr::wrap, single items, like the Model will now be wrapped in an array before going into the Illuminate Collection.

This issue was caused by the refactoring around augmentation in #435.

Fixes duncanmcclean/simple-commerce#1016

github-actions[bot] commented 4 months ago

Released as part of v6.2.2.