From 40ecb6a248dd571fd3aef5f6b043314809d03994 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 15 Aug 2024 07:32:58 +1000 Subject: [PATCH] Fixes for subs v1 + setting guard on repo activities --- app/Livewire/BillingPortalPurchase.php | 4 ++++ app/Repositories/BaseRepository.php | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/Livewire/BillingPortalPurchase.php b/app/Livewire/BillingPortalPurchase.php index 2acb2eee917d..96d7e8dcdd3e 100644 --- a/app/Livewire/BillingPortalPurchase.php +++ b/app/Livewire/BillingPortalPurchase.php @@ -349,7 +349,11 @@ class BillingPortalPurchase extends Component } if ((int)$this->price == 0) { + $this->steps['payment_required'] = false; + $this->steps['fetched_payment_methods'] = false; + $this->heading_text = ctrans('texts.payment_methods'); + return $this; } else { // $this->steps['fetched_payment_methods'] = true; } diff --git a/app/Repositories/BaseRepository.php b/app/Repositories/BaseRepository.php index 24248c58b08f..3e4ff6b4e557 100644 --- a/app/Repositories/BaseRepository.php +++ b/app/Repositories/BaseRepository.php @@ -58,7 +58,7 @@ class BaseRepository $className = $this->getEventClass($entity, 'Archived'); if (class_exists($className)) { - event(new $className($entity, $entity->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); + event(new $className($entity, $entity->company, Ninja::eventVars(auth()->guard('api')->user() ? auth()->guard('api')->user()->id : null))); } } @@ -84,7 +84,7 @@ class BaseRepository $className = $this->getEventClass($entity, 'Restored'); if (class_exists($className)) { - event(new $className($entity, $fromDeleted, $entity->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); + event(new $className($entity, $fromDeleted, $entity->company, Ninja::eventVars(auth()->guard('api')->user() ? auth()->guard('api')->user()->id : null))); } } @@ -105,7 +105,7 @@ class BaseRepository $className = $this->getEventClass($entity, 'Deleted'); if (class_exists($className) && !($entity instanceof Company)) { - event(new $className($entity, $entity->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); + event(new $className($entity, $entity->company, Ninja::eventVars(auth()->guard('api')->user() ? auth()->guard('api')->user()->id : null))); } }