Skip to content

Instantly share code, notes, and snippets.

@haydar
Created September 29, 2018 18:15
Show Gist options
  • Save haydar/386e21aba0dc0b2e3c08d89b0e268b6e to your computer and use it in GitHub Desktop.
Save haydar/386e21aba0dc0b2e3c08d89b0e268b6e 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;
use App\User;
class YeniKayit
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $user;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct(User $user)
{
$this->user=$user;
}
/**
* Get the channels the event should broadcast on.
*
* @return \Illuminate\Broadcasting\Channel|array
*/
public function broadcastOn()
{
return new PrivateChannel('channel-name');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment