mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 04:57:35 -05:00 
			
		
		
		
	Fixes for subdomain resolution for MultiDB
This commit is contained in:
		
							parent
							
								
									b89b6ef38d
								
							
						
					
					
						commit
						364f7addb6
					
				@ -41,7 +41,7 @@ class SetDomainNameDb
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        if (strpos($request->getHost(), 'invoicing.co') !== false) 
 | 
					        if (strpos($request->getHost(), 'invoicing.co') !== false) 
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            $subdomain = array_first(explode('.', $request->getHost()));
 | 
					            $subdomain = explode('.', $request->getHost())[0];
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            $query = [
 | 
					            $query = [
 | 
				
			||||||
                'subdomain' => $subdomain,
 | 
					                'subdomain' => $subdomain,
 | 
				
			||||||
 | 
				
			|||||||
@ -33,6 +33,7 @@ class SubscriptionTransformer extends EntityTransformer
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    public function transform(Subscription $subscription): array
 | 
					    public function transform(Subscription $subscription): array
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        $company = $subscription->company;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return [
 | 
					        return [
 | 
				
			||||||
            'id' => $this->encodePrimaryKey($subscription->id),
 | 
					            'id' => $this->encodePrimaryKey($subscription->id),
 | 
				
			||||||
@ -59,7 +60,8 @@ class SubscriptionTransformer extends EntityTransformer
 | 
				
			|||||||
            'allow_plan_changes' => (bool)$subscription->allow_plan_changes,
 | 
					            'allow_plan_changes' => (bool)$subscription->allow_plan_changes,
 | 
				
			||||||
            'refund_period' => (int)$subscription->refund_period,
 | 
					            'refund_period' => (int)$subscription->refund_period,
 | 
				
			||||||
            'webhook_configuration' => $subscription->webhook_configuration ?: [],
 | 
					            'webhook_configuration' => $subscription->webhook_configuration ?: [],
 | 
				
			||||||
            'purchase_page' => (string)route('client.subscription.purchase', $subscription->hashed_id),
 | 
					            'purchase_page' => (string)$company->domain() .  "/client/subscription/{$subscription->hashed_id}/purchase",
 | 
				
			||||||
 | 
					            //'purchase_page' => (string)route('client.subscription.purchase', $subscription->hashed_id),
 | 
				
			||||||
            'currency_id' => (string) $subscription->currency_id,
 | 
					            'currency_id' => (string) $subscription->currency_id,
 | 
				
			||||||
            'is_deleted' => (bool)$subscription->is_deleted,
 | 
					            'is_deleted' => (bool)$subscription->is_deleted,
 | 
				
			||||||
            'created_at' => (int)$subscription->created_at,
 | 
					            'created_at' => (int)$subscription->created_at,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user