35 lines
784 B
PHP
35 lines
784 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Events;
|
||
|
|
|
||
|
|
use App\Models\Site;
|
||
|
|
use App\Models\Ticket;
|
||
|
|
use DragonCode\Contracts\Queue\ShouldQueue;
|
||
|
|
use Illuminate\Broadcasting\PrivateChannel;
|
||
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
||
|
|
use Illuminate\Queue\SerializesModels;
|
||
|
|
|
||
|
|
class TicketCreated implements ShouldQueue
|
||
|
|
{
|
||
|
|
use Dispatchable;
|
||
|
|
use SerializesModels;
|
||
|
|
|
||
|
|
public function __construct(
|
||
|
|
public readonly Site $siteReceivingTicket,
|
||
|
|
public readonly Ticket $ticket,
|
||
|
|
public readonly string $byUserName
|
||
|
|
) {}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get the channels the event should broadcast on.
|
||
|
|
*
|
||
|
|
* @return array<int, \Illuminate\Broadcasting\Channel>
|
||
|
|
*/
|
||
|
|
public function broadcastOn(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
new PrivateChannel('default'),
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|