Test Setup Failed
Pull Request — develop (#200)
by Tony
04:29
created

DeviceUpdated::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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