mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-24 07:55:35 +00:00
Update Cart.php
This commit is contained in:
@@ -150,8 +150,8 @@ class Cart
|
|||||||
/* Also allow passing multiple definitions at the same time, simply call same method and collec return value */
|
/* Also allow passing multiple definitions at the same time, simply call same method and collec return value */
|
||||||
else if (is_iterable($id)) {
|
else if (is_iterable($id)) {
|
||||||
/* Check if this iterable contains instances */
|
/* Check if this iterable contains instances */
|
||||||
if (is_array(head($item)) || head($item) instanceof Buyable) {
|
if (is_array(head($id)) || head($id) instanceof Buyable) {
|
||||||
return array_map(function ($item) {
|
return array_map(function (Buyable|iterable $item) {
|
||||||
return $this->add($item);
|
return $this->add($item);
|
||||||
}, $id);
|
}, $id);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user