]> git.localhorst.tv Git - alttp.git/blob - app/Events/UserChanged.php
switch SNES default port
[alttp.git] / app / Events / UserChanged.php
1 <?php
2
3 namespace App\Events;
4
5 use App\Models\User;
6 use Illuminate\Broadcasting\Channel;
7 use Illuminate\Broadcasting\InteractsWithSockets;
8 use Illuminate\Broadcasting\PresenceChannel;
9 use Illuminate\Broadcasting\PrivateChannel;
10 use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
11 use Illuminate\Foundation\Events\Dispatchable;
12 use Illuminate\Queue\SerializesModels;
13
14 class UserChanged implements ShouldBroadcast
15 {
16         use Dispatchable, InteractsWithSockets, SerializesModels;
17
18         /**
19          * Create a new event instance.
20          *
21          * @return void
22          */
23         public function __construct(User $user)
24         {
25                 $this->user = $user;
26         }
27
28         /**
29          * Get the channels the event should broadcast on.
30          *
31          * @return \Illuminate\Broadcasting\Channel|array
32          */
33         public function broadcastOn()
34         {
35                 return [
36                         new Channel('App.Control'),
37                         new PrivateChannel('App.Models.User.'.$this->user->id),
38                 ];
39         }
40
41         public $user;
42
43 }