You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pixelfed/app/Events/LiveStream/StreamEnd.php

47 lines
921 B
PHTML

<?php
namespace App\Events\LiveStream;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class StreamEnd implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $id;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct($id)
{
$this->id = $id;
}
/**
* Get the channels the event should broadcast on.
*
4 weeks ago
* @return Channel|array
*/
public function broadcastOn()
{
9 months ago
return new Channel('live.chat.'.$this->id);
}
public function broadcastAs()
{
return 'stream.end';
}
public function broadcastWith(): array
{
9 months ago
return ['ts' => time()];
}
}