mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-11 18:54:33 +00:00
Update Cart.php
This commit is contained in:
@@ -134,7 +134,7 @@ class Cart
|
||||
}
|
||||
/* Also allow passing a Buyable instance, get data from the instance rather than parameters */
|
||||
else if ($id instanceof Buyable) {
|
||||
if (! is_int($nameOrQty)) {
|
||||
if (! is_null($qtyOrOptions) && ! is_int($nameOrQty)) {
|
||||
throw new InvalidArgumentException('$nameOrQty must be of int (quantity) when adding a Buyable instance');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user