mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-03 23:37:33 -05:00 
			
		
		
		
	Subscription table view client portal
This commit is contained in:
		
							parent
							
								
									0cd984b29b
								
							
						
					
					
						commit
						d7ff984818
					
				@ -21,20 +21,20 @@ class SubscriptionController extends Controller
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    public function index()
 | 
					    public function index()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (Ninja::isHosted()) {
 | 
					        // if (Ninja::isHosted()) {
 | 
				
			||||||
            $count = RecurringInvoice::query()
 | 
					        //     $count = RecurringInvoice::query()
 | 
				
			||||||
                ->where('client_id', auth()->guard('contact')->user()->client->id)
 | 
					        //         ->where('client_id', auth()->guard('contact')->user()->client->id)
 | 
				
			||||||
                ->where('company_id', auth()->guard('contact')->user()->client->company_id)
 | 
					        //         ->where('company_id', auth()->guard('contact')->user()->client->company_id)
 | 
				
			||||||
                ->where('status_id', RecurringInvoice::STATUS_ACTIVE)
 | 
					        //         ->where('status_id', RecurringInvoice::STATUS_ACTIVE)
 | 
				
			||||||
                ->where('is_deleted', 0)
 | 
					        //         ->where('is_deleted', 0)
 | 
				
			||||||
                ->whereNotNull('subscription_id')
 | 
					        //         ->whereNotNull('subscription_id')
 | 
				
			||||||
                ->withTrashed()
 | 
					        //         ->withTrashed()
 | 
				
			||||||
                ->count();
 | 
					        //         ->count();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if ($count == 0) {
 | 
					        //     if ($count == 0) {
 | 
				
			||||||
                return redirect()->route('client.ninja_contact_login', ['contact_key' => auth()->guard('contact')->user()->contact_key, 'company_key' => auth()->guard('contact')->user()->company->company_key]);
 | 
					        //         return redirect()->route('client.ninja_contact_login', ['contact_key' => auth()->guard('contact')->user()->contact_key, 'company_key' => auth()->guard('contact')->user()->company->company_key]);
 | 
				
			||||||
            }
 | 
					        //     }
 | 
				
			||||||
        }
 | 
					        // }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return render('subscriptions.index');
 | 
					        return render('subscriptions.index');
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user