Fixes for event parameters

This commit is contained in:
David Bomba 2020-07-14 08:06:28 +10:00
parent 5af23a4072
commit 1d7ba6d1e6
6 changed files with 11 additions and 7 deletions

View File

@ -7,6 +7,7 @@ use App\Events\Invoice\InvoiceWasCreated;
use App\Factory\InvoiceFactory;
use App\Factory\InvoiceItemFactory;
use App\Helpers\Invoice\InvoiceSum;
use App\Jobs\Util\VersionCheck;
use App\Models\CompanyToken;
use App\Models\Country;
use App\Models\Product;
@ -77,6 +78,7 @@ class DemoMode extends Command
$this->info("Seeding Random Data");
$this->createSmallAccount();
VersionCheck::dispatchNow();
}

View File

@ -48,7 +48,7 @@ class InvitationController extends Controller
if (!request()->has('silent')) {
$invitation->markViewed();
event(new InvitationWasViewed($entity, $invitation, $entity->company, Ninja::eventVars()));
event(new InvitationWasViewed($invitation->{$entity}, $invitation, $invitation->{$entity}->company, Ninja::eventVars()));
}
return redirect()->route('client.'.$entity.'.show', [$entity => $this->encodePrimaryKey($invitation->{$key})]);

View File

@ -42,7 +42,7 @@ class InvitationViewedListener implements ShouldQueue
{
MultiDB::setDb($event->company->db);
$entity_name = $event->entity;
$entity_name = lcfirst(class_basename($event->entity));
$invitation = $event->invitation;
$notification = new EntityViewedNotification($invitation, $entity_name);

View File

@ -85,7 +85,8 @@ class EntityPaidObject
'invoice' => $invoice_texts,
]
),
'url' => config('ninja.app_url') . '/payments/' . $this->payment->hashed_id,
'url' => config('ninja.app_url'),
// 'url' => config('ninja.app_url') . '/payments/' . $this->payment->hashed_id, //because we have no deep linking we cannot use this
'button' => ctrans('texts.view_payment'),
'signature' => $settings->email_signature,
'logo' => $this->company->present()->logo(),

View File

@ -14,6 +14,7 @@ namespace App\PaymentDrivers;
use App\Models\ClientGatewayToken;
use App\Models\GatewayType;
use App\Models\Invoice;
use App\Models\Payment;
use App\PaymentDrivers\Authorize\AuthorizeCreditCard;
use App\PaymentDrivers\Authorize\AuthorizePaymentMethod;

View File

@ -55,14 +55,14 @@ trait Inviteable
switch ($this->company->portal_mode) {
case 'subdomain':
return $domain .'/client/'. $entity_type .'/'. $this->key;
return $domain .'client/'. $entity_type .'/'. $this->key;
break;
case 'iframe':
return $domain .'/client/'. $entity_type .'/'. $this->key;
return $domain .'client/'. $entity_type .'/'. $this->key;
//return $domain . $entity_type .'/'. $this->contact->client->client_hash .'/'. $this->key;
break;
case 'domain':
return $domain .'/client/'. $entity_type .'/'. $this->key;
return $domain .'client/'. $entity_type .'/'. $this->key;
break;
}