Skip to content

Instantly share code, notes, and snippets.

@yusidabcs
Created May 24, 2018 06:59
Show Gist options
  • Save yusidabcs/e3c38c30f3b7a5d4050823143819b90d to your computer and use it in GitHub Desktop.
Save yusidabcs/e3c38c30f3b7a5d4050823143819b90d to your computer and use it in GitHub Desktop.
<?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 SendGlobalNotification implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $message,$name;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct($name)
{
$this->name = $name;
$this->message = '{name} say hello.';
}
/**
* Get the channels the event should broadcast on.
*
* @return \Illuminate\Broadcasting\Channel|array
*/
public function broadcastOn()
{
return 'global-notif';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment