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

SettingDeleted::__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 1
dl 0
loc 5
rs 9.4285
c 1
b 0
f 0
1
<?php
2
3
namespace App\Events;
4
5
use App\Models\DbConfig;
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 Log;
12
13
class SettingDeleted implements ShouldBroadcast
14
{
15
    use Dispatchable, InteractsWithSockets;
16
17
    public $setting;
18
19
    /**
20
     * Create a new event instance.
21
     *
22
     * @param $setting
23
     */
24
    public function __construct(DbConfig $setting)
25
    {
26
        Log::info($setting);
27
        $this->setting = $setting->config_name;
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