Completed
Push — master ( 285219...48efb4 )
by Quim González
03:39
created

LogedUser::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
3
namespace App\Events;
4
5
use App\User;
6
use Illuminate\Broadcasting\Channel;
7
use Illuminate\Queue\SerializesModels;
8
use Illuminate\Broadcasting\PrivateChannel;
9
use Illuminate\Broadcasting\PresenceChannel;
10
use Illuminate\Foundation\Events\Dispatchable;
11
use Illuminate\Broadcasting\InteractsWithSockets;
12
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
13
14
class LogedUser
15
{
16
    use Dispatchable, InteractsWithSockets, SerializesModels;
17
18
    public $user;
19
20
    /**
21
     * LoggedUser constructor.
22
     * @param $user
23
     */
24
    public function __construct(User $user)
25
    {
26
        $this->user = $user;
27
    }
28
29
30
    /**
31
     * Get the channels the event should broadcast on.
32
     *
33
     * @return \Illuminate\Broadcasting\Channel|array
34
     */
35
    public function broadcastOn()
36
    {
37
        return new PrivateChannel('channel-name');
38
    }
39
}
40