From 076c1d2e381925e54c5dff433f30348c905de020 Mon Sep 17 00:00:00 2001 From: Andre Madarang Date: Sun, 17 Mar 2019 19:43:21 -0400 Subject: [PATCH] Update event->fire to event->dispatch --- src/Cart.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Cart.php b/src/Cart.php index 789609a0..26233114 100644 --- a/src/Cart.php +++ b/src/Cart.php @@ -25,7 +25,7 @@ class Cart /** * Instance of the event dispatcher. - * + * * @var \Illuminate\Contracts\Events\Dispatcher */ private $events; @@ -103,8 +103,8 @@ public function add($id, $name = null, $qty = null, $price = null, array $option } $content->put($cartItem->rowId, $cartItem); - - $this->events->fire('cart.added', $cartItem); + + $this->events->dispatch('cart.added', $cartItem); $this->session->put($this->instance, $content); @@ -148,7 +148,7 @@ public function update($rowId, $qty) $content->put($cartItem->rowId, $cartItem); } - $this->events->fire('cart.updated', $cartItem); + $this->events->dispatch('cart.updated', $cartItem); $this->session->put($this->instance, $content); @@ -169,7 +169,7 @@ public function remove($rowId) $content->pull($cartItem->rowId); - $this->events->fire('cart.removed', $cartItem); + $this->events->dispatch('cart.removed', $cartItem); $this->session->put($this->instance, $content); } @@ -349,8 +349,8 @@ public function setTax($rowId, $taxRate) public function store($identifier) { $content = $this->getContent(); - - + + $this->getConnection() ->table($this->getTableName()) ->where('identifier', $identifier) @@ -363,7 +363,7 @@ public function store($identifier) 'content' => serialize($content) ]); - $this->events->fire('cart.stored'); + $this->events->dispatch('cart.stored'); } /** @@ -393,16 +393,16 @@ public function restore($identifier) $content->put($cartItem->rowId, $cartItem); } - $this->events->fire('cart.restored'); + $this->events->dispatch('cart.restored'); $this->session->put($this->instance, $content); $this->instance($currentInstance); - + } - - + + /** * Deletes the stored cart with given identifier * @@ -414,9 +414,9 @@ protected function deleteStoredCart($identifier) { ->where('identifier', $identifier) ->delete(); } - - - + + + /** * Magic method to make accessing the total, tax and subtotal properties possible. *