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

LogedUser   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A broadcastOn() 0 3 1
A __construct() 0 3 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