LukePOLO\LaraCart\LaraCart::get PHP Method

get() public method

Gets the instance in the session.
public get ( string $instance = 'default' )
$instance string
    public function get($instance = 'default')
    {
        if (config('laracart.cross_devices', false) && $this->authManager->check()) {
            if (!empty($cartSessionID = $this->authManager->user()->cart_session_id)) {
                $this->session->setId($cartSessionID);
                $this->session->start();
            }
        }
        if (empty($this->cart = $this->session->get($this->prefix . '.' . $instance))) {
            $this->cart = new Cart($instance);
        }
        return $this;
    }