Test Setup Failed
Push — vue-test ( c87041...4c6bf5 )
by Tony
04:34
created

SettingUpdated::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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