namespace App\Events;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class Message extends Event implements ShouldBroadcast
{
protected $message;
public function __construct($message)
{
$this->message= $message;
}
public function broadcastOn()
{
return ['MessageChannel'];
}
public function broadcastWith()
{
return ['message' => $this->message];
}
}
event(new App\Events\Message('Test publish!!!'));
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.