Fixes for subs v1 + setting guard on repo activities

This commit is contained in:
David Bomba 2024-08-15 07:32:58 +10:00
parent f938f371e5
commit 40ecb6a248
2 changed files with 7 additions and 3 deletions

View File

@ -349,7 +349,11 @@ class BillingPortalPurchase extends Component
} }
if ((int)$this->price == 0) { if ((int)$this->price == 0) {
$this->steps['payment_required'] = false; $this->steps['payment_required'] = false;
$this->steps['fetched_payment_methods'] = false;
$this->heading_text = ctrans('texts.payment_methods');
return $this;
} else { } else {
// $this->steps['fetched_payment_methods'] = true; // $this->steps['fetched_payment_methods'] = true;
} }

View File

@ -58,7 +58,7 @@ class BaseRepository
$className = $this->getEventClass($entity, 'Archived'); $className = $this->getEventClass($entity, 'Archived');
if (class_exists($className)) { 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'); $className = $this->getEventClass($entity, 'Restored');
if (class_exists($className)) { 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'); $className = $this->getEventClass($entity, 'Deleted');
if (class_exists($className) && !($entity instanceof Company)) { 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)));
} }
} }