mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Send company with all events
This commit is contained in:
parent
27d2f18cc7
commit
245980ce4b
@ -32,14 +32,16 @@ class AccountCreated
|
||||
*/
|
||||
public $user;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($user)
|
||||
public function __construct($user, $company)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->company = $company;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -12,13 +12,14 @@
|
||||
namespace App\Events\Client;
|
||||
|
||||
use App\Models\Client;
|
||||
use App\Models\Company;
|
||||
use Illuminate\Broadcasting\Channel;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Broadcasting\PrivateChannel;
|
||||
use Illuminate\Broadcasting\PresenceChannel;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Broadcasting\PresenceChannel;
|
||||
use Illuminate\Broadcasting\PrivateChannel;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* Class ClientWasArchived.
|
||||
@ -32,14 +33,16 @@ class ClientWasArchived
|
||||
*/
|
||||
public $client;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Client $client
|
||||
*/
|
||||
public function __construct(Client $client)
|
||||
public function __construct(Client $client, Company $company)
|
||||
{
|
||||
$this->client = $client;
|
||||
$this->company = $company;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -26,13 +26,15 @@ class ClientWasCreated
|
||||
*/
|
||||
public $client;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Client $client
|
||||
*/
|
||||
public function __construct(Client $client)
|
||||
public function __construct(Client $client, Company $company)
|
||||
{
|
||||
$this->client = $client;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,15 @@ class ClientWasDeleted
|
||||
*/
|
||||
public $client;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Client $client
|
||||
*/
|
||||
public function __construct(Client $client)
|
||||
public function __construct(Client $client, Company $company)
|
||||
{
|
||||
$this->client = $client;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,15 @@ class ClientWasRestored
|
||||
*/
|
||||
public $client;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Client $client
|
||||
*/
|
||||
public function __construct(Client $client)
|
||||
public function __construct(Client $client, Company $company)
|
||||
{
|
||||
$this->client = $client;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,15 @@ class ClientWasUpdated
|
||||
*/
|
||||
public $client;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Client $client
|
||||
*/
|
||||
public function __construct(Client $client)
|
||||
public function __construct(Client $client, Company $company)
|
||||
{
|
||||
$this->client = $client;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events\CompanyToken;
|
||||
|
||||
use App\Models\CompanyToken;
|
||||
use Illuminate\Broadcasting\Channel;
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Broadcasting\PresenceChannel;
|
||||
use Illuminate\Broadcasting\PrivateChannel;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class CompanyTokenWasDeleted
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
/**
|
||||
* @var Company
|
||||
*/
|
||||
public $company_token;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Company $company
|
||||
*/
|
||||
public function __construct(CompanyToken $company_token)
|
||||
{
|
||||
$this->company_token = $company_token;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the channels the event should broadcast on.
|
||||
*
|
||||
* @return \Illuminate\Broadcasting\Channel|array
|
||||
*/
|
||||
public function broadcastOn()
|
||||
{
|
||||
return new PrivateChannel('channel-name');
|
||||
}
|
||||
}
|
@ -33,14 +33,17 @@ class ContactLoggedIn
|
||||
*/
|
||||
public $client_contact;
|
||||
|
||||
public $company;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(ClientContact $client_contact)
|
||||
public function __construct(ClientContact $client_contact, $company)
|
||||
{
|
||||
$this->client_contact = $client_contact;
|
||||
$this->company = $company;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -13,13 +13,16 @@ class CreditWasEmailed
|
||||
|
||||
public $credit;
|
||||
|
||||
public $company;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Credit $credit)
|
||||
public function __construct(Credit $credit, $company)
|
||||
{
|
||||
$this->credit = $credit;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -15,10 +15,14 @@ class CreditWasEmailedAndFailed
|
||||
|
||||
public $errors;
|
||||
|
||||
public function __construct(Credit $credit, array $errors)
|
||||
public $company;
|
||||
|
||||
public function __construct(Credit $credit, $company, array $errors)
|
||||
{
|
||||
$this->credit = $credit;
|
||||
|
||||
$this->company = $company;
|
||||
|
||||
$this->errors = $errors;
|
||||
}
|
||||
}
|
||||
|
@ -32,14 +32,17 @@ class DesignWasArchived
|
||||
*/
|
||||
public $design;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Design $design
|
||||
*/
|
||||
public function __construct(Design $design)
|
||||
public function __construct(Design $design, $company)
|
||||
{
|
||||
$this->design = $design;
|
||||
|
||||
$this->company = $company;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -26,14 +26,17 @@ class DesignWasCreated
|
||||
*/
|
||||
public $design;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Design $design
|
||||
*/
|
||||
public function __construct(Design $design)
|
||||
public function __construct(Design $design, $company)
|
||||
{
|
||||
$this->design = $design;
|
||||
|
||||
$this->company = $company;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -26,14 +26,17 @@ class DesignWasDeleted
|
||||
*/
|
||||
public $design;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Design $design
|
||||
*/
|
||||
public function __construct(Design $design)
|
||||
public function __construct(Design $design, $company)
|
||||
{
|
||||
$this->design = $design;
|
||||
|
||||
$this->company = $company;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -26,14 +26,17 @@ class DesignWasRestored
|
||||
*/
|
||||
public $design;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Design $design
|
||||
*/
|
||||
public function __construct(Design $design)
|
||||
public function __construct(Design $design, $company)
|
||||
{
|
||||
$this->design = $design;
|
||||
|
||||
$this->company = $company;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -26,14 +26,17 @@ class DesignWasUpdated
|
||||
*/
|
||||
public $design;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Design $design
|
||||
*/
|
||||
public function __construct(Design $design)
|
||||
public function __construct(Design $design, $company)
|
||||
{
|
||||
$this->design = $design;
|
||||
|
||||
$this->company = $company;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -32,14 +32,16 @@ class DocumentWasArchived
|
||||
*/
|
||||
public $document;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Document $document
|
||||
*/
|
||||
public function __construct(Document $document)
|
||||
public function __construct(Document $document, $company)
|
||||
{
|
||||
$this->document = $document;
|
||||
$this->company = $company;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -26,13 +26,15 @@ class DocumentWasCreated
|
||||
*/
|
||||
public $document;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Document $document
|
||||
*/
|
||||
public function __construct(Document $document)
|
||||
public function __construct(Document $document, $company)
|
||||
{
|
||||
$this->document = $document;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,15 @@ class DocumentWasDeleted
|
||||
*/
|
||||
public $document;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Document $document
|
||||
*/
|
||||
public function __construct(Document $document)
|
||||
public function __construct(Document $document, $company)
|
||||
{
|
||||
$this->document = $document;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,15 @@ class DocumentWasRestored
|
||||
*/
|
||||
public $document;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Document $document
|
||||
*/
|
||||
public function __construct(Document $document)
|
||||
public function __construct(Document $document, $company)
|
||||
{
|
||||
$this->document = $document;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,15 @@ class DocumentWasUpdated
|
||||
*/
|
||||
public $document;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Document $document
|
||||
*/
|
||||
public function __construct(Document $document)
|
||||
public function __construct(Document $document, $company)
|
||||
{
|
||||
$this->document = $document;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,15 @@ class ExpenseWasArchived
|
||||
*/
|
||||
public $expense;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Expense $expense
|
||||
*/
|
||||
public function __construct(Expense $expense)
|
||||
public function __construct(Expense $expense, $company)
|
||||
{
|
||||
$this->expense = $expense;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,15 @@ class ExpenseWasCreated
|
||||
*/
|
||||
public $expense;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Expense $expense
|
||||
*/
|
||||
public function __construct(Expense $expense)
|
||||
public function __construct(Expense $expense, $company)
|
||||
{
|
||||
$this->expense = $expense;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,15 @@ class ExpenseWasDeleted
|
||||
*/
|
||||
public $expense;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Expense $expense
|
||||
*/
|
||||
public function __construct(Expense $expense)
|
||||
public function __construct(Expense $expense, $company)
|
||||
{
|
||||
$this->expense = $expense;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,15 @@ class ExpenseWasRestored
|
||||
*/
|
||||
public $expense;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Expense $expense
|
||||
*/
|
||||
public function __construct(Expense $expense)
|
||||
public function __construct(Expense $expense, $company)
|
||||
{
|
||||
$this->expense = $expense;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,15 @@ class ExpenseWasUpdated
|
||||
*/
|
||||
public $expense;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Expense $expense
|
||||
*/
|
||||
public function __construct(Expense $expense)
|
||||
public function __construct(Expense $expense, $company)
|
||||
{
|
||||
$this->expense = $expense;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,15 @@ class InvoiceWasArchived
|
||||
*/
|
||||
public $invoice;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
*/
|
||||
public function __construct(Invoice $invoice)
|
||||
public function __construct(Invoice $invoice, $company)
|
||||
{
|
||||
$this->invoice = $invoice;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,15 @@ class InvoiceWasCancelled
|
||||
*/
|
||||
public $invoice;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
*/
|
||||
public function __construct(Invoice $invoice)
|
||||
public function __construct(Invoice $invoice, $company)
|
||||
{
|
||||
$this->invoice = $invoice;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,15 @@ class InvoiceWasDeleted
|
||||
*/
|
||||
public $invoice;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
*/
|
||||
public function __construct(Invoice $invoice)
|
||||
public function __construct(Invoice $invoice, $company)
|
||||
{
|
||||
$this->invoice = $invoice;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,15 @@ class InvoiceWasEmailed
|
||||
*/
|
||||
public $invitation;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
*/
|
||||
public function __construct(InvoiceInvitation $invitation)
|
||||
public function __construct(InvoiceInvitation $invitation, $company)
|
||||
{
|
||||
$this->invitation = $invitation;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -31,15 +31,19 @@ class InvoiceWasEmailedAndFailed
|
||||
*/
|
||||
public $errors;
|
||||
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
*/
|
||||
public function __construct(Invoice $invoice, array $errors)
|
||||
public function __construct(Invoice $invoice, $company, array $errors)
|
||||
{
|
||||
$this->invoice = $invoice;
|
||||
|
||||
$this->company = $company;
|
||||
|
||||
$this->errors = $errors;
|
||||
}
|
||||
}
|
||||
|
@ -28,15 +28,17 @@ class InvoiceWasRestored
|
||||
|
||||
public $fromDeleted;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
* @param $fromDeleted
|
||||
*/
|
||||
public function __construct(Invoice $invoice, $fromDeleted)
|
||||
public function __construct(Invoice $invoice, $fromDeleted, $company)
|
||||
{
|
||||
$this->invoice = $invoice;
|
||||
$this->fromDeleted = $fromDeleted;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,15 @@ class InvoiceWasReversed
|
||||
*/
|
||||
public $invoice;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
*/
|
||||
public function __construct(Invoice $invoice)
|
||||
public function __construct(Invoice $invoice, $company)
|
||||
{
|
||||
$this->invoice = $invoice;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -27,14 +27,17 @@ class InvitationWasViewed
|
||||
public $invitation;
|
||||
|
||||
public $entity;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
*/
|
||||
public function __construct($entity, $invitation)
|
||||
public function __construct($entity, $invitation, $company)
|
||||
{
|
||||
$this->entity = $entity;
|
||||
$this->invitation = $invitation;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -20,14 +20,16 @@ class MethodDeleted
|
||||
*/
|
||||
private $payment_method;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param ClientGatewayToken $payment_method
|
||||
*/
|
||||
public function __construct(ClientGatewayToken $payment_method)
|
||||
public function __construct(ClientGatewayToken $payment_method, $company)
|
||||
{
|
||||
$this->payment_method = $payment_method;
|
||||
$this->company = $company;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -26,13 +26,15 @@ class PaymentCompleted
|
||||
*/
|
||||
public $payment;
|
||||
|
||||
public $company
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Payment $payment
|
||||
*/
|
||||
public function __construct(Payment $payment)
|
||||
public function __construct(Payment $payment, $company)
|
||||
{
|
||||
$this->payment = $payment;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,15 @@ class PaymentFailed
|
||||
*/
|
||||
public $payment;
|
||||
|
||||
public $company
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Payment $payment
|
||||
*/
|
||||
public function __construct(Payment $payment)
|
||||
public function __construct(Payment $payment, $company)
|
||||
{
|
||||
$this->payment = $payment;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,15 @@ class PaymentWasArchived
|
||||
*/
|
||||
public $payment;
|
||||
|
||||
public $company
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Payment $payment
|
||||
*/
|
||||
public function __construct(Payment $payment)
|
||||
public function __construct(Payment $payment, $company)
|
||||
{
|
||||
$this->payment = $payment;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,15 @@ class PaymentWasDeleted
|
||||
*/
|
||||
public $payment;
|
||||
|
||||
public $company
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Payment $payment
|
||||
*/
|
||||
public function __construct(Payment $payment)
|
||||
public function __construct(Payment $payment, $company)
|
||||
{
|
||||
$this->payment = $payment;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,12 +26,15 @@ class PaymentWasEmailed
|
||||
*/
|
||||
public $payment;
|
||||
|
||||
public $company
|
||||
/**
|
||||
* PaymentWasEmailed constructor.
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Payment $payment
|
||||
*/
|
||||
public function __construct(Payment $payment)
|
||||
public function __construct(Payment $payment, $company)
|
||||
{
|
||||
$this->payment = $payment;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -31,15 +31,18 @@ class PaymentWasEmailedAndFailed
|
||||
*/
|
||||
public $errors;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* PaymentWasEmailedAndFailed constructor.
|
||||
* @param Payment $payment
|
||||
* @param array $errors
|
||||
*/
|
||||
public function __construct(Payment $payment, array $errors)
|
||||
public function __construct(Payment $payment, $company, array $errors)
|
||||
{
|
||||
$this->payment = $payment;
|
||||
|
||||
$this->errors = $errors;
|
||||
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -28,15 +28,17 @@ class PaymentWasRefunded
|
||||
|
||||
public $refund_amount;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Payment $payment
|
||||
* @param $refund_amount
|
||||
*/
|
||||
public function __construct(Payment $payment, $refund_amount)
|
||||
public function __construct(Payment $payment, $refund_amount, $company)
|
||||
{
|
||||
$this->payment = $payment;
|
||||
$this->refund_amount = $refund_amount;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,16 +26,17 @@ class PaymentWasRestored
|
||||
*/
|
||||
public $payment;
|
||||
public $fromDeleted;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Payment $payment
|
||||
* @param $fromDeleted
|
||||
*/
|
||||
public function __construct(Payment $payment, $fromDeleted)
|
||||
public function __construct(Payment $payment, $fromDeleted, $company)
|
||||
{
|
||||
$this->payment = $payment;
|
||||
$this->fromDeleted = $fromDeleted;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,15 @@ class PaymentWasVoided
|
||||
*/
|
||||
public $payment;
|
||||
|
||||
public $company
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Payment $payment
|
||||
*/
|
||||
public function __construct(Payment $payment)
|
||||
public function __construct(Payment $payment, $company)
|
||||
{
|
||||
$this->payment = $payment;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -28,14 +28,17 @@ class ProductWasCreated
|
||||
**/
|
||||
public $input;
|
||||
|
||||
public $company;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Product $product, $input = null)
|
||||
public function __construct(Product $product, $input = null, $company)
|
||||
{
|
||||
$this->product = $product;
|
||||
$this->input = $input;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -23,13 +23,15 @@ class ProductWasDeleted
|
||||
*/
|
||||
public $product;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Product $product)
|
||||
public function __construct(Product $product, $company)
|
||||
{
|
||||
$this->product = $product;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -28,14 +28,17 @@ class ProductWasUpdated
|
||||
**/
|
||||
public $input;
|
||||
|
||||
public $company;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Product $product, $input = null)
|
||||
public function __construct(Product $product, $input = null, $company)
|
||||
{
|
||||
$this->product = $product;
|
||||
$this->input = $input;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -17,13 +17,15 @@ class QuoteWasApproved
|
||||
|
||||
public $quote;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Quote $quote)
|
||||
public function __construct(Quote $quote, $company)
|
||||
{
|
||||
$this->quote = $quote;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -18,14 +18,15 @@ class QuoteWasArchived
|
||||
use SerializesModels;
|
||||
|
||||
public $quote;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param $quote
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($quote)
|
||||
public function __construct(Quote $quote, $company)
|
||||
{
|
||||
$this->quote = $quote;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -19,15 +19,17 @@ use Illuminate\Queue\SerializesModels;
|
||||
class QuoteWasCreated
|
||||
{
|
||||
use SerializesModels;
|
||||
|
||||
public $quote;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param $quote
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($quote)
|
||||
public function __construct(Quote $quote, $company)
|
||||
{
|
||||
$this->quote = $quote;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -21,13 +21,15 @@ class QuoteWasDeleted
|
||||
use SerializesModels;
|
||||
public $quote;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param $quote
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($quote)
|
||||
public function __construct(Quote $quote, $company)
|
||||
{
|
||||
$this->quote = $quote;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -19,8 +19,11 @@ use Illuminate\Queue\SerializesModels;
|
||||
class QuoteWasEmailed
|
||||
{
|
||||
use SerializesModels;
|
||||
|
||||
public $quote;
|
||||
|
||||
public $company;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
@ -31,9 +34,11 @@ class QuoteWasEmailed
|
||||
*
|
||||
* @param $quote
|
||||
*/
|
||||
public function __construct($quote, $notes)
|
||||
public function __construct($quote, $notes, $company)
|
||||
{
|
||||
$this->quote = $quote;
|
||||
$this->notes = $notes;
|
||||
$this->company = $company;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -26,6 +26,8 @@ class QuoteWasEmailedAndFailed
|
||||
*/
|
||||
public $quote;
|
||||
|
||||
public $company;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
@ -36,10 +38,12 @@ class QuoteWasEmailedAndFailed
|
||||
* @param Quote $quote
|
||||
* @param array $errors
|
||||
*/
|
||||
public function __construct(Quote $quote, array $errors)
|
||||
public function __construct(Quote $quote, array $errors, $company)
|
||||
{
|
||||
$this->quote = $quote;
|
||||
|
||||
$this->errors = $errors;
|
||||
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -21,13 +21,15 @@ class QuoteWasRestored
|
||||
use SerializesModels;
|
||||
public $quote;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param $quote
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($quote)
|
||||
public function __construct(Quote $quote, $company)
|
||||
{
|
||||
$this->quote = $quote;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -21,13 +21,14 @@ class QuoteWasUpdated
|
||||
use SerializesModels;
|
||||
public $quote;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param $quote
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($quote)
|
||||
public function __construct(Quote $quote, $company)
|
||||
{
|
||||
$this->quote = $quote;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,16 @@ class TaskWasArchived
|
||||
*/
|
||||
public $task;
|
||||
|
||||
public $company;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Task $task
|
||||
*/
|
||||
public function __construct(Task $task)
|
||||
public function __construct(Task $task, $company)
|
||||
{
|
||||
$this->task = $task;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,16 @@ class TaskWasCreated
|
||||
*/
|
||||
public $task;
|
||||
|
||||
public $company;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Task $task
|
||||
*/
|
||||
public function __construct(Task $task)
|
||||
public function __construct(Task $task, $company)
|
||||
{
|
||||
$this->task = $task;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,16 @@ class TaskWasDeleted
|
||||
*/
|
||||
public $task;
|
||||
|
||||
public $company;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Task $task
|
||||
*/
|
||||
public function __construct(Task $task)
|
||||
public function __construct(Task $task, $company)
|
||||
{
|
||||
$this->task = $task;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,16 @@ class TaskWasRestored
|
||||
*/
|
||||
public $task;
|
||||
|
||||
public $company;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Task $task
|
||||
*/
|
||||
public function __construct(Task $task)
|
||||
public function __construct(Task $task, $company)
|
||||
{
|
||||
$this->task = $task;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,16 @@ class TaskWasUpdated
|
||||
*/
|
||||
public $task;
|
||||
|
||||
public $company;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Task $task
|
||||
*/
|
||||
public function __construct(Task $task)
|
||||
public function __construct(Task $task, $company)
|
||||
{
|
||||
$this->task = $task;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -32,14 +32,16 @@ class UserLoggedIn
|
||||
*/
|
||||
public $user;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($user)
|
||||
public function __construct($user, $company)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->company = $company;
|
||||
}
|
||||
|
||||
/**
|
||||
|
4
app/Events/Vendor/VendorWasArchived.php
vendored
4
app/Events/Vendor/VendorWasArchived.php
vendored
@ -27,13 +27,15 @@ class VendorWasArchived
|
||||
*/
|
||||
public $vendor;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Vendor $vendor
|
||||
*/
|
||||
public function __construct(Vendor $vendor)
|
||||
public function __construct(Vendor $vendor, $company)
|
||||
{
|
||||
$this->vendor = $vendor;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
4
app/Events/Vendor/VendorWasCreated.php
vendored
4
app/Events/Vendor/VendorWasCreated.php
vendored
@ -26,13 +26,15 @@ class VendorWasCreated
|
||||
*/
|
||||
public $vendor;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Vendor $vendor
|
||||
*/
|
||||
public function __construct(Vendor $vendor)
|
||||
public function __construct(Vendor $vendor, $company)
|
||||
{
|
||||
$this->vendor = $vendor;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
4
app/Events/Vendor/VendorWasDeleted.php
vendored
4
app/Events/Vendor/VendorWasDeleted.php
vendored
@ -26,13 +26,15 @@ class VendorWasDeleted
|
||||
*/
|
||||
public $vendor;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Vendor $vendor
|
||||
*/
|
||||
public function __construct(Vendor $vendor)
|
||||
public function __construct(Vendor $vendor, $company)
|
||||
{
|
||||
$this->vendor = $vendor;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
4
app/Events/Vendor/VendorWasRestored.php
vendored
4
app/Events/Vendor/VendorWasRestored.php
vendored
@ -26,13 +26,15 @@ class VendorWasRestored
|
||||
*/
|
||||
public $vendor;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Vendor $vendor
|
||||
*/
|
||||
public function __construct(Vendor $vendor)
|
||||
public function __construct(Vendor $vendor, $company)
|
||||
{
|
||||
$this->vendor = $vendor;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
4
app/Events/Vendor/VendorWasUpdated.php
vendored
4
app/Events/Vendor/VendorWasUpdated.php
vendored
@ -26,13 +26,15 @@ class VendorWasUpdated
|
||||
*/
|
||||
public $vendor;
|
||||
|
||||
public $company;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Vendor $vendor
|
||||
*/
|
||||
public function __construct(Vendor $vendor)
|
||||
public function __construct(Vendor $vendor, $company)
|
||||
{
|
||||
$this->vendor = $vendor;
|
||||
$this->company = $company;
|
||||
}
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ class ContactLoginController extends Controller
|
||||
{
|
||||
Auth::guard('contact')->login($client, true);
|
||||
|
||||
event(new ContactLoggedIn($client));
|
||||
event(new ContactLoggedIn($client, $client->company));
|
||||
|
||||
if (session()->get('url.intended')) {
|
||||
return redirect(session()->get('url.intended'));
|
||||
|
@ -47,7 +47,7 @@ class InvitationController extends Controller
|
||||
if (!request()->has('silent')) {
|
||||
$invitation->markViewed();
|
||||
|
||||
event(new InvitationWasViewed($entity, $invitation));
|
||||
event(new InvitationWasViewed($entity, $invitation, $entity->company));
|
||||
}
|
||||
|
||||
return redirect()->route('client.'.$entity.'.show', [$entity => $this->encodePrimaryKey($invitation->{$key})]);
|
||||
|
@ -716,7 +716,7 @@ class InvoiceController extends BaseController
|
||||
});
|
||||
|
||||
if ($invoice->invitations->count() > 0) {
|
||||
event(new InvoiceWasEmailed($invoice->invitations->first()));
|
||||
event(new InvoiceWasEmailed($invoice->invitations->first(), $invoice->company));
|
||||
}
|
||||
|
||||
if (!$bulk) {
|
||||
|
@ -53,7 +53,7 @@ class ContactTokenAuth
|
||||
//stateless, don't remember the contact.
|
||||
auth()->guard('contact')->login($client_contact, false);
|
||||
|
||||
event(new ContactLoggedIn($client_contact)); //todo
|
||||
event(new ContactLoggedIn($client_contact, $client_contact->company)); //todo
|
||||
} else {
|
||||
$error = [
|
||||
'message' => 'Invalid token',
|
||||
|
@ -72,7 +72,7 @@ class CreateAccount
|
||||
$sp2d97e8 = CreateCompanyToken::dispatchNow($sp035a66, $spaa9f78, $spafe62e);
|
||||
|
||||
if ($spaa9f78) {
|
||||
event(new AccountCreated($spaa9f78));
|
||||
event(new AccountCreated($spaa9f78, $sp035a66));
|
||||
}
|
||||
|
||||
$spaa9f78->fresh();
|
||||
|
@ -69,13 +69,13 @@ class EmailCredit implements ShouldQueue
|
||||
->send(new TemplateEmail($message_array, $template_style, $invitation->contact->user, $invitation->contact->client));
|
||||
|
||||
if (count(Mail::failures()) > 0) {
|
||||
event(new CreditWasEmailedAndFailed($this->credit, Mail::failures()));
|
||||
event(new CreditWasEmailedAndFailed($this->credit, $this->credit->company, Mail::failures()));
|
||||
|
||||
return $this->logMailError($errors);
|
||||
}
|
||||
|
||||
//fire any events
|
||||
event(new CreditWasEmailed($this->credit));
|
||||
event(new CreditWasEmailed($this->credit, $this->company));
|
||||
|
||||
//sleep(5);
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ class ReminderJob implements ShouldQueue
|
||||
});
|
||||
|
||||
if ($invoice->invitations->count() > 0) {
|
||||
event(new InvoiceWasEmailed($invoice->invitations->first()));
|
||||
event(new InvoiceWasEmailed($invoice->invitations->first(), $invoice->company));
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -26,7 +26,7 @@ class ClientObserver
|
||||
*/
|
||||
public function created(Client $client)
|
||||
{
|
||||
event(new ClientWasCreated($client));
|
||||
event(new ClientWasCreated($client, $client->company));
|
||||
|
||||
SubscriptionHandler::dispatch(Subscription::EVENT_CREATE_CLIENT, $client);
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ use App\Events\Client\DesignWasRestored;
|
||||
use App\Events\Client\DesignWasUpdated;
|
||||
use App\Events\Company\CompanyWasDeleted;
|
||||
use App\Events\Contact\ContactLoggedIn;
|
||||
use App\Events\Credit\CreditWasEmailedAndFailed;
|
||||
use App\Events\Credit\CreditWasMarkedSent;
|
||||
use App\Events\Design\DesignWasArchived;
|
||||
use App\Events\Invoice\InvoiceWasCancelled;
|
||||
@ -122,6 +123,10 @@ class EventServiceProvider extends ServiceProvider
|
||||
],
|
||||
DocumentWasRestored::class =>[
|
||||
],
|
||||
CreditWasEmailedAndFailed::class => [
|
||||
],
|
||||
CreditWasEmailed::class => [
|
||||
],
|
||||
CreditWasMarkedSent::class => [
|
||||
],
|
||||
//Designs
|
||||
|
@ -78,7 +78,7 @@ class BaseRepository
|
||||
$className = $this->getEventClass($entity, 'Archived');
|
||||
|
||||
if (class_exists($className)) {
|
||||
event(new $className($entity));
|
||||
event(new $className($entity, $entity->company));
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ class BaseRepository
|
||||
$className = $this->getEventClass($entity, 'Restored');
|
||||
|
||||
if (class_exists($className)) {
|
||||
event(new $className($entity, $fromDeleted));
|
||||
event(new $className($entity, $fromDeleted, $entity->company));
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,7 +125,7 @@ class BaseRepository
|
||||
$className = $this->getEventClass($entity, 'Deleted');
|
||||
|
||||
if (class_exists($className)) {
|
||||
event(new $className($entity));
|
||||
event(new $className($entity, $entity->company));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ class InvoiceRepository extends BaseRepository
|
||||
|
||||
$invoice->delete();
|
||||
|
||||
event(new InvoiceWasDeleted($invoice));
|
||||
event(new InvoiceWasDeleted($invoice, $invoice->company));
|
||||
|
||||
return $invoice;
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ class HandleCancellation extends AbstractService
|
||||
//adjust client balance
|
||||
$this->invoice->client->service()->updateBalance($adjustment)->save();
|
||||
|
||||
event(new InvoiceWasCancelled($this->invoice));
|
||||
event(new InvoiceWasCancelled($this->invoice, $this->invoice->company));
|
||||
|
||||
|
||||
return $this->invoice;
|
||||
|
@ -109,7 +109,7 @@ class HandleReversal extends AbstractService
|
||||
->updatePaidToDate($total_paid*-1)
|
||||
->save();
|
||||
|
||||
event(new InvoiceWasReversed($this->invoice));
|
||||
event(new InvoiceWasReversed($this->invoice, $this->invoice->company));
|
||||
|
||||
return $this->invoice;
|
||||
//create a ledger row for this with the resulting Credit ( also include an explanation in the notes section )
|
||||
|
Loading…
x
Reference in New Issue
Block a user