| @@ 54-63 (lines=10) @@ | ||
| 51 | * @param CartRepository $repository |
|
| 52 | * @return bool |
|
| 53 | */ |
|
| 54 | public function exists(CartRepository $repository) |
|
| 55 | { |
|
| 56 | try { |
|
| 57 | return $repository->exists() ? 'true' : 'false'; |
|
| 58 | } catch (Exception $e) { |
|
| 59 | Log::error($e->getMessage()); |
|
| 60 | ||
| 61 | abort(500, $e->getMessage()); |
|
| 62 | } |
|
| 63 | } |
|
| 64 | ||
| 65 | /** |
|
| 66 | * Show the current cart. |
|
| @@ 71-80 (lines=10) @@ | ||
| 68 | * @param \Bedard\Shop\Repositories\CartRepository $repository |
|
| 69 | * @return \Bedard\Shop\Models\Cart |
|
| 70 | */ |
|
| 71 | public function index(CartRepository $repository) |
|
| 72 | { |
|
| 73 | try { |
|
| 74 | return $repository->loadCart(); |
|
| 75 | } catch (Exception $e) { |
|
| 76 | Log::error($e->getMessage()); |
|
| 77 | ||
| 78 | abort(500, $e->getMessage()); |
|
| 79 | } |
|
| 80 | } |
|
| 81 | ||
| 82 | /** |
|
| 83 | * Delete an item from the cart. |
|