master

laravel/framework

Last updated at: 29/12/2023 09:21

ShouldBroadcast.php

TLDR

This file is an interface called ShouldBroadcast located in the Illuminate\Contracts\Broadcasting namespace. It defines a method called broadcastOn().

Methods

broadcastOn

This method returns the channels on which the event should be broadcasted. It can return either a single channel as a string, an array of channels as strings, a single channel object of type \Illuminate\Broadcasting\Channel, or an array of channel objects.

<?php

namespace Illuminate\Contracts\Broadcasting;

interface ShouldBroadcast
{
    /**
     * Get the channels the event should broadcast on.
     *
     * @return \Illuminate\Broadcasting\Channel|\Illuminate\Broadcasting\Channel[]|string[]|string
     */
    public function broadcastOn();
}