Ctrl K
ComunidadGuías…

app/Events/ApplicationStopFailed.php

Rama main · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
<?php

namespace App\Events;

use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

/**
 * Tells the application page that a queued stop did not stop the application.
 */
class ApplicationStopFailed implements ShouldBroadcastNow
{
    use Dispatchable, SerializesModels;

    public function __construct(
        public int $teamId,
        public string $applicationUuid,
        public string $message,
    ) {}

    public function broadcastOn(): array
    {
        return [new PrivateChannel("team.{$this->teamId}")];
    }

    /**
     * The team channel also reaches members without access to the application, so only Coolify can read the data.
     *
     * @return array{payload: string}
     */
    public function broadcastWith(): array
    {
        return ['payload' => encrypt([
            'teamId' => $this->teamId,
            'applicationUuid' => $this->applicationUuid,
            'message' => $this->message,
        ])];
    }
}