public function setInstance($instance = 'default')
    {
        $this->get($instance);

        $this->session->put($this->prefix.'.instance', $instance);

        if (!in_array($instance, $this->getInstances())) {
            $this->session->push($this->prefix.'.instances', $instance);
        }
        $this->events->dispatch('laracart.new');

        return $this;
    }
public function setInstance($instance = 'default')
    {
        $this->get($instance);

        $this->session->put($this->prefix.'.instance', $instance);

        if (!in_array($instance, $this->getInstances())) {
            $this->session->push($this->prefix.'.instances', $instance);
        }
        $this->events->dispatch('laracart.new');

        return $this;
    }
public function setInstance ( $ instance = 'default' ) { $ this -> get ( $ instance ) ; $ this -> session -> put ( $ this -> prefix . '.instance' , $ instance ) ; if ( ! in_array ( $ instance , $ this -> getInstances ( ) ) ) { $ this -> session -> push ( $ this -> prefix . '.instances' , $ instance ) ; } $ this -> events -> dispatch ( 'laracart.new' ) ; return $ this ; }
Sets and Gets the instance of the cart in the session we should be using.

@param string $instance

@return LaraCart
Sets and Gets the instance of the cart in the session we should be using .