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))); } });