Skip to content

Instantly share code, notes, and snippets.

@itoonx
Created March 2, 2018 23:08
Show Gist options
  • Save itoonx/6bdf511d308a0302a1f3949ddbe953bc to your computer and use it in GitHub Desktop.
Save itoonx/6bdf511d308a0302a1f3949ddbe953bc to your computer and use it in GitHub Desktop.
ExamplePusherEvent
<?php
namespace App\Events;
use Illuminate\Broadcasting\Channel;
use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class eventPusher implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
/**
* Create a new event instance.
*
* @return void
*/
public $message;
public function __construct($message)
{
//
$this->message = $message;
}
/**
* Get the channels the event should broadcast on.
*
* @return \Illuminate\Broadcasting\Channel|array
*/
public function broadcastOn()
{
return new Channel('my-channel');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment