| @@ 35-44 (lines=10) @@ | ||
| 32 | * @param CartRepository $repository |
|
| 33 | * @return bool |
|
| 34 | */ |
|
| 35 | public function exists(CartRepository $repository) |
|
| 36 | { |
|
| 37 | try { |
|
| 38 | return $repository->exists() ? 'true' : 'false'; |
|
| 39 | } catch (Exception $e) { |
|
| 40 | Log::error($e->getMessage()); |
|
| 41 | ||
| 42 | abort(500, $e->getMessage()); |
|
| 43 | } |
|
| 44 | } |
|
| 45 | ||
| 46 | /** |
|
| 47 | * Show the current cart. |
|
| @@ 52-61 (lines=10) @@ | ||
| 49 | * @param \Bedard\Shop\Repositories\CartRepository $repository |
|
| 50 | * @return \Bedard\Shop\Models\Cart |
|
| 51 | */ |
|
| 52 | public function index(CartRepository $repository) |
|
| 53 | { |
|
| 54 | try { |
|
| 55 | return $repository->loadCart(); |
|
| 56 | } catch (Exception $e) { |
|
| 57 | Log::error($e->getMessage()); |
|
| 58 | ||
| 59 | abort(500, $e->getMessage()); |
|
| 60 | } |
|
| 61 | } |
|
| 62 | ||
| 63 | /** |
|
| 64 | * Remove an item from the cart. |
|