Advertisement
Guest User

Untitled

a guest
May 25th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. $options_collection = new Collection;
  2. foreach($p->variants as $variant) {
  3. $options_collection->push([
  4. 'variant_id' => $variant->id,
  5. 'options_id' => $variant->options->map(
  6. function($item, $key) {
  7. return $item->option_id;
  8. }
  9. )
  10. ]);
  11. }
  12. return $options_collection;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement