PushNotificationEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Pratiksh\Adminetic\Events;
4
5
use Illuminate\Broadcasting\InteractsWithSockets;
6
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
7
use Illuminate\Foundation\Events\Dispatchable;
8
use Illuminate\Queue\SerializesModels;
9
10
class PushNotificationEvent implements ShouldBroadcastNow
11
{
12
    use Dispatchable, InteractsWithSockets, SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by Pratiksh\Adminetic\Events\PushNotificationEvent: $id, $relations, $class, $connection, $keyBy
Loading history...
13
14
    public $message;
15
16
    /**
17
     * Create a new event instance.
18
     *
19
     * @return void
20
     */
21
    public function __construct($message)
22
    {
23
        $this->message = $message;
24
    }
25
26
    /**
27
     * Get the channels the event should broadcast on.
28
     *
29
     * @return \Illuminate\Broadcasting\Channel|array
30
     */
31
    public function broadcastOn()
32
    {
33
        return ['push_notification'];
34
    }
35
36
    public function broadcastAs()
37
    {
38
        return 'push-notification-event';
39
    }
40
}
41