src/ShopifyApp/ShopifyApp.php
public function shop(string $shopDomain = null)
    {
        $shopifyDomain = $shopDomain ? $this->sanitizeShopDomain($shopDomain) : (new ShopSession())->getDomain();
        if (!$this->shop && $shopifyDomain) {
            // Grab shop from database here
            $shopModel = Config::get('shopify-app.shop_model');
            $shop = $shopModel::withTrashed()->firstOrCreate(['shopify_domain' => $shopifyDomain]);

            // Update shop instance
            $this->shop = $shop;
        }

        return $this->shop;
    }
public function shop(string $shopDomain = null)
    {
        $shopifyDomain = $shopDomain ? $this->sanitizeShopDomain($shopDomain) : (new ShopSession())->getDomain();
        if (!$this->shop && $shopifyDomain) {
            // Grab shop from database here
            $shopModel = Config::get('shopify-app.shop_model');
            $shop = $shopModel::withTrashed()->firstOrCreate(['shopify_domain' => $shopifyDomain]);

            // Update shop instance
            $this->shop = $shop;
        }

        return $this->shop;
    }
public function shop ( string $ shopDomain = null ) { $ shopifyDomain = $ shopDomain ? $ this -> sanitizeShopDomain ( $ shopDomain ) : ( new ShopSession ( ) ) -> getDomain ( ) ; if ( ! $ this -> shop && $ shopifyDomain ) { // Grab shop from database here $ shopModel = Config :: get ( 'shopify-app.shop_model' ) ; $ shop = $ shopModel :: withTrashed ( ) -> firstOrCreate ( [ 'shopify_domain' => $ shopifyDomain ] ) ; // Update shop instance $ this -> shop = $ shop ; } return $ this -> shop ; }
Gets/sets the current shop.

@param string|null $shopDomain

@return \OhMyBrew\ShopifyApp\Models\Shop
Gets / sets the current shop .