protected function createCart()
    {
        if (config('vanilo.cart.auto_assign_user') && Auth::check()) {
            $attributes = [
                'user_id' => Auth::user()->id
            ];
        }

        return $this->setCartModel(CartProxy::create($attributes ?? []));
    }
protected function createCart()
    {
        if (config('vanilo.cart.auto_assign_user') && Auth::check()) {
            $attributes = [
                'user_id' => Auth::user()->id
            ];
        }

        return $this->setCartModel(CartProxy::create($attributes ?? []));
    }
protected function createCart ( ) { if ( config ( 'vanilo.cart.auto_assign_user' ) && Auth :: check ( ) ) { $ attributes = [ 'user_id' => Auth :: user ( ) -> id ] ; } return $ this -> setCartModel ( CartProxy :: create ( $ attributes ?? [ ] ) ) ; }
Creates a new cart model and saves it's id in the session
Creates a new cart model and saves it s id in the session