diff --git a/app/Http/Controllers/ClientPortal/CreditController.php b/app/Http/Controllers/ClientPortal/CreditController.php index 3e69220a1563..9d00714bc4ad 100644 --- a/app/Http/Controllers/ClientPortal/CreditController.php +++ b/app/Http/Controllers/ClientPortal/CreditController.php @@ -34,7 +34,7 @@ class CreditController extends Controller $data = [ 'credit' => $credit, - 'key' => $invitation->key + 'key' => $invitation ? $invitation->key : false ]; if ($invitation && auth()->guard('contact') && ! request()->has('silent') && ! $invitation->viewed_date) { diff --git a/app/Http/Controllers/ClientPortal/InvoiceController.php b/app/Http/Controllers/ClientPortal/InvoiceController.php index 5c9d0bcad82e..b6789e8dfdd8 100644 --- a/app/Http/Controllers/ClientPortal/InvoiceController.php +++ b/app/Http/Controllers/ClientPortal/InvoiceController.php @@ -61,7 +61,7 @@ class InvoiceController extends Controller $invoice->service()->removeUnpaidGatewayFees()->save(); - $invitation = $invoice->invitations()->where('client_contact_id', auth()->user()->id)->first(); + $invitation = $invoice->invitations()->where('client_contact_id', auth()->guard('contact')->user()->id)->first(); if ($invitation && auth()->guard('contact') && ! request()->has('silent') && ! $invitation->viewed_date) { @@ -74,7 +74,7 @@ class InvoiceController extends Controller $data = [ 'invoice' => $invoice, - 'key' => $invitation->key + 'key' => $invitation ? $invitation->key : false ]; if ($request->query('mode') === 'fullscreen') { diff --git a/app/Http/Controllers/ClientPortal/QuoteController.php b/app/Http/Controllers/ClientPortal/QuoteController.php index 03b0a648af39..c527d7b7fd46 100644 --- a/app/Http/Controllers/ClientPortal/QuoteController.php +++ b/app/Http/Controllers/ClientPortal/QuoteController.php @@ -63,7 +63,7 @@ class QuoteController extends Controller $data = [ 'quote' => $quote, - 'key' => $invitation->key, + 'key' => $invitation ? $invitation->key : false, ]; if ($invitation && auth()->guard('contact') && ! request()->has('silent') && ! $invitation->viewed_date) { diff --git a/resources/views/portal/ninja2020/credits/show.blade.php b/resources/views/portal/ninja2020/credits/show.blade.php index 28be1ee665da..0504dce30de7 100644 --- a/resources/views/portal/ninja2020/credits/show.blade.php +++ b/resources/views/portal/ninja2020/credits/show.blade.php @@ -17,12 +17,14 @@ {{ ctrans('texts.entity_number_placeholder', ['entity' => ctrans('texts.credit'), 'entity_number' => $credit->number]) }} -