mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 10:24:32 -04:00
refactor invoice was paid
This commit is contained in:
parent
48a6053100
commit
a59e0388c0
@ -15,8 +15,7 @@ namespace App\Events\Invoice;
|
|||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
use App\Models\Invoice;
|
use App\Models\Invoice;
|
||||||
use App\Models\Payment;
|
use App\Models\Payment;
|
||||||
use Illuminate\Broadcasting\Channel;
|
use App\Utils\Traits\Invoice\Broadcasting\DefaultInvoiceBroadcast;
|
||||||
use Illuminate\Broadcasting\PrivateChannel;
|
|
||||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||||
use Illuminate\Queue\SerializesModels;
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
|
||||||
@ -25,7 +24,7 @@ use Illuminate\Queue\SerializesModels;
|
|||||||
*/
|
*/
|
||||||
class InvoiceWasPaid implements ShouldBroadcast
|
class InvoiceWasPaid implements ShouldBroadcast
|
||||||
{
|
{
|
||||||
use SerializesModels;
|
use SerializesModels, DefaultInvoiceBroadcast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Invoice
|
* @var Invoice
|
||||||
@ -52,16 +51,4 @@ class InvoiceWasPaid implements ShouldBroadcast
|
|||||||
$this->company = $company;
|
$this->company = $company;
|
||||||
$this->event_vars = $event_vars;
|
$this->event_vars = $event_vars;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function broadcastOn(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
new PrivateChannel("{$this->company->company_key}.invoices"),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function broadcastAs(): string
|
|
||||||
{
|
|
||||||
return 'invoice.paid';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user