public function removeCartItem($cartItemId)
    {
        $items = collect(session($this->itemsKey));

        $items = $items->reject(function ($item) use ($cartItemId) {
            return $item['id'] == $cartItemId;
        });

        session([$this->itemsKey => $items]);
    }
public function removeCartItem($cartItemId)
    {
        $items = collect(session($this->itemsKey));

        $items = $items->reject(function ($item) use ($cartItemId) {
            return $item['id'] == $cartItemId;
        });

        session([$this->itemsKey => $items]);
    }
public function removeCartItem ( $ cartItemId ) { $ items = collect ( session ( $ this -> itemsKey ) ) ; $ items = $ items -> reject ( function ( $ item ) use ( $ cartItemId ) { return $ item [ 'id' ] == $ cartItemId ; } ) ; session ( [ $ this -> itemsKey => $ items ] ) ; }
Removes a cart item from the cart.

@param int Cart item id
@return void
Removes a cart item from the cart .