From 16a2210de860d7b788522b4fae018b08a95844cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=2E=20Nagy=20Gerg=C5=91?= Date: Fri, 3 May 2024 22:27:45 +0200 Subject: [PATCH] fix --- src/Models/Cart.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Models/Cart.php b/src/Models/Cart.php index 3aad9794..808f02a2 100644 --- a/src/Models/Cart.php +++ b/src/Models/Cart.php @@ -5,7 +5,6 @@ use Cone\Bazar\Bazar; use Cone\Bazar\Database\Factories\CartFactory; use Cone\Bazar\Exceptions\CartException; -use Cone\Bazar\Interfaces\Buyable; use Cone\Bazar\Interfaces\Models\Cart as Contract; use Cone\Bazar\Traits\Addressable; use Cone\Bazar\Traits\InteractsWithDiscounts; @@ -191,9 +190,9 @@ public function scopeExpired(Builder $query): Builder */ public function toOrder(): Order { - $this->lineItems->each(function (Buyable $buyable): void { - if (! $buyable->buyable($this->order)) { - throw new CartException(sprintf('Unable to add [%s] item to the order.', get_class($buyable))); + $this->lineItems->each(function (Item $item): void { + if (! $item->buyable->buyable($this->order)) { + throw new CartException(sprintf('Unable to add [%s] item to the order.', get_class($item->buyable))); } });