Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
milwad-dev committed Jul 1, 2024
1 parent 86abe04 commit a5ea3ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/Models/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ public function storeItem(Model|array $item): Cart
$this->items()->save($item);
}


return $this;
}

Expand Down
6 changes: 3 additions & 3 deletions src/Observers/CartItemObserve.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CartItemObserve
public function creating(CartItem $cartItem): void
{
if (! new $cartItem->itemable_type instanceof Cartable) {
throw new \Exception('The item must be an instance of Cartable');
throw new \RuntimeException('The item must be an instance of Cartable');
}
}

Expand All @@ -23,7 +23,7 @@ public function creating(CartItem $cartItem): void
public function updating(CartItem $cartItem): void
{
if (! new $cartItem->itemable_type instanceof Cartable) {
throw new \Exception('The item must be an instance of Cartable');
throw new \RuntimeException('The item must be an instance of Cartable');
}
}

Expand All @@ -33,7 +33,7 @@ public function updating(CartItem $cartItem): void
public function saving(CartItem $cartItem): void
{
if (! new $cartItem->itemable_type instanceof Cartable) {
throw new \Exception('The item must be an instance of Cartable');
throw new \RuntimeException('The item must be an instance of Cartable');
}
}
}

0 comments on commit a5ea3ce

Please sign in to comment.