Skip to content

Commit

Permalink
Merge pull request #6 from drehimself/master
Browse files Browse the repository at this point in the history
Update event->fire to event->dispatch
  • Loading branch information
hardevine authored Mar 18, 2019
2 parents 4573962 + 076c1d2 commit 05de8fd
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Cart

/**
* Instance of the event dispatcher.
*
*
* @var \Illuminate\Contracts\Events\Dispatcher
*/
private $events;
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand All @@ -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);
}
Expand Down Expand Up @@ -349,8 +349,8 @@ public function setTax($rowId, $taxRate)
public function store($identifier)
{
$content = $this->getContent();


$this->getConnection()
->table($this->getTableName())
->where('identifier', $identifier)
Expand All @@ -363,7 +363,7 @@ public function store($identifier)
'content' => serialize($content)
]);

$this->events->fire('cart.stored');
$this->events->dispatch('cart.stored');
}

/**
Expand Down Expand Up @@ -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
*
Expand All @@ -414,9 +414,9 @@ protected function deleteStoredCart($identifier) {
->where('identifier', $identifier)
->delete();
}



/**
* Magic method to make accessing the total, tax and subtotal properties possible.
*
Expand Down

0 comments on commit 05de8fd

Please sign in to comment.