adrema/app/Invoice/Events/InvoicesMassStored.php

37 lines
814 B
PHP
Raw Normal View History

2023-12-20 23:38:09 +01:00
<?php
namespace App\Invoice\Events;
use App\Invoice\Models\Invoice;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Collection;
class InvoicesMassStored
{
use Dispatchable, InteractsWithSockets, SerializesModels;
/**
* Create a new event instance.
*
* @param Collection<int, Invoice> $invoices
* @return void
*/
public function __construct(public int $year, public Collection $invoices)
{
//
}
/**
* Get the channels the event should broadcast on.
*
2023-12-21 13:38:42 +01:00
* @return PrivateChannel
2023-12-20 23:38:09 +01:00
*/
public function broadcastOn()
{
return new PrivateChannel('channel-name');
}
}