coolify/app/Events/ApplicationDeploymentFinished.php

39 lines
1,015 B
PHP
Raw Normal View History

2023-12-04 14:08:24 +00:00
<?php
2023-12-04 19:47:32 +00:00
namespace App\Events;
2023-12-04 14:08:24 +00:00
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;
2023-12-04 14:42:08 +00:00
class ApplicationDeploymentFinished implements ShouldBroadcast
2023-12-04 14:08:24 +00:00
{
use Dispatchable, InteractsWithSockets, SerializesModels;
2023-12-04 19:47:32 +00:00
public ?int $teamId = null;
/**
* Create a new event instance.
*/
public function __construct(public ?string $applicationUuid = null, public ?string $status = null)
2023-12-04 14:08:24 +00:00
{
2023-12-04 19:47:32 +00:00
$this->teamId = auth()->user()->currentTeam()->id;
2023-12-04 14:08:24 +00:00
}
2023-12-04 19:47:32 +00:00
/**
* Get the channels the event should broadcast on.
*
* @return array<int, \Illuminate\Broadcasting\Channel>
*/
2023-12-04 14:08:24 +00:00
public function broadcastOn(): array
{
return [
2023-12-04 19:47:32 +00:00
new PrivateChannel("custom.{$this->teamId}"),
2023-12-04 14:08:24 +00:00
];
}
}