src/ShopifyApp/Traits/ShopModelTrait.php
public function planCharge()
    {
        return $this->charges()
            ->whereIn('type', [Charge::CHARGE_RECURRING, Charge::CHARGE_ONETIME])
            ->where('plan_id', $this->plan_id)
            ->orderBy('created_at', 'desc')
            ->first();
    }
public function planCharge()
    {
        return $this->charges()
            ->whereIn('type', [Charge::CHARGE_RECURRING, Charge::CHARGE_ONETIME])
            ->where('plan_id', $this->plan_id)
            ->orderBy('created_at', 'desc')
            ->first();
    }
public function planCharge ( ) { return $ this -> charges ( ) -> whereIn ( 'type' , [ Charge :: CHARGE_RECURRING , Charge :: CHARGE_ONETIME ] ) -> where ( 'plan_id' , $ this -> plan_id ) -> orderBy ( 'created_at' , 'desc' ) -> first ( ) ; }
Gets the last single or recurring charge for the shop.

@return null|\OhMyBrew\ShopifyApp\Models\Charge
Gets the last single or recurring charge for the shop .