Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $options_collection = new Collection;
- foreach($p->variants as $variant) {
- $options_collection->push([
- 'variant_id' => $variant->id,
- 'options_id' => $variant->options->map(
- function($item, $key) {
- return $item->option_id;
- }
- )
- ]);
- }
- return $options_collection;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement