<?php

namespace App\Traits\Restock;

use App\Models\RestockItem;

trait WithRestockDeleteItem
{
    public function deleteItem(RestockItem $item): void
    {
        $this->canOrAbort('create restock');

        $item->delete();

        $this->restockItems = $this->loadRestockItems();
        $this->toast('Item berhasil dihapus dari keranjang.');
    }
}
