public function items()
    {
        $sessionId = $this->getSessionId();
        $userId = $this->auth->id();
        $items = $this->cartItem->getWithBuilder($this->instance, $this->getSessionId(), $userId)->get();

        return $items->filter(function ($item) {
            // Remove CartItem if product not exists
            if (empty($item->product)) {
                $item->delete();

                return false;
            }

            return true;
        });
    }
public function items()
    {
        $sessionId = $this->getSessionId();
        $userId = $this->auth->id();
        $items = $this->cartItem->getWithBuilder($this->instance, $this->getSessionId(), $userId)->get();

        return $items->filter(function ($item) {
            // Remove CartItem if product not exists
            if (empty($item->product)) {
                $item->delete();

                return false;
            }

            return true;
        });
    }
public function items ( ) { $ sessionId = $ this -> getSessionId ( ) ; $ userId = $ this -> auth -> id ( ) ; $ items = $ this -> cartItem -> getWithBuilder ( $ this -> instance , $ this -> getSessionId ( ) , $ userId ) -> get ( ) ; return $ items -> filter ( function ( $ item ) { // Remove CartItem if product not exists if ( empty ( $ item -> product ) ) { $ item -> delete ( ) ; return false ; } return true ; } ) ; }
Get all cart items
@return mixed
Get all cart items