mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-21 14:55:02 +00:00
Merge branch 'master' into fix_cart_database_timestamps
This commit is contained in:
10
src/Cart.php
10
src/Cart.php
@@ -164,7 +164,7 @@ class Cart
|
||||
|
||||
$content->put($item->rowId, $item);
|
||||
|
||||
$this->events->fire('cart.added', $item);
|
||||
$this->events->dispatch('cart.added', $item);
|
||||
|
||||
$this->session->put($this->instance, $content);
|
||||
|
||||
@@ -210,7 +210,7 @@ class Cart
|
||||
$content->put($cartItem->rowId, $cartItem);
|
||||
}
|
||||
|
||||
$this->events->fire('cart.updated', $cartItem);
|
||||
$this->events->dispatch('cart.updated', $cartItem);
|
||||
|
||||
$this->session->put($this->instance, $content);
|
||||
|
||||
@@ -232,7 +232,7 @@ class Cart
|
||||
|
||||
$content->pull($cartItem->rowId);
|
||||
|
||||
$this->events->fire('cart.removed', $cartItem);
|
||||
$this->events->dispatch('cart.removed', $cartItem);
|
||||
|
||||
$this->session->put($this->instance, $content);
|
||||
}
|
||||
@@ -599,7 +599,7 @@ class Cart
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
]);
|
||||
|
||||
$this->events->fire('cart.stored');
|
||||
$this->events->dispatch('cart.stored');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -634,7 +634,7 @@ class Cart
|
||||
$content->put($cartItem->rowId, $cartItem);
|
||||
}
|
||||
|
||||
$this->events->fire('cart.restored');
|
||||
$this->events->dispatch('cart.restored');
|
||||
|
||||
$this->session->put($this->instance, $content);
|
||||
|
||||
|
||||
@@ -377,7 +377,10 @@ class CartItem implements Arrayable, Jsonable
|
||||
return with(new $this->associatedModel())->find($this->id);
|
||||
}
|
||||
|
||||
return;
|
||||
case 'modelFQCN':
|
||||
if (isset($this->associatedModel)) {
|
||||
return $this->associatedModel;
|
||||
}
|
||||
|
||||
default:
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user