| @@ 15-21 (lines=7) @@ | ||
| 12 | * @param CartRepository $repository |
|
| 13 | * @return \Bedard\Shop\Models\CartItem |
|
| 14 | */ |
|
| 15 | public function add(CartRepository $repository) |
|
| 16 | { |
|
| 17 | $inventoryId = (int) input('inventoryId'); |
|
| 18 | $quantity = (int) input('quantity') ?: 1; |
|
| 19 | ||
| 20 | return $repository->add($inventoryId, $quantity); |
|
| 21 | } |
|
| 22 | ||
| 23 | /** |
|
| 24 | * Find the current cart. |
|
| @@ 70-76 (lines=7) @@ | ||
| 67 | * @param CartRepository $repository |
|
| 68 | * @return \Bedard\Shop\Models\CartItem |
|
| 69 | */ |
|
| 70 | public function update(CartRepository $repository) |
|
| 71 | { |
|
| 72 | $inventoryId = (int) input('inventoryId'); |
|
| 73 | $quantity = (int) input('quantity') ?: 1; |
|
| 74 | ||
| 75 | return $repository->update($inventoryId, $quantity); |
|
| 76 | } |
|
| 77 | } |
|
| 78 | ||