| Total Complexity | 3 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | class NotificationEvent extends Event implements ShouldBroadcast |
||
| 18 | { |
||
| 19 | use InteractsWithSockets, SerializesModels; |
||
|
|
|||
| 20 | |||
| 21 | /** @var array */ |
||
| 22 | private $data; |
||
| 23 | |||
| 24 | /** @var int */ |
||
| 25 | private $userId; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * NotificationEvent constructor. |
||
| 29 | * |
||
| 30 | * Initialize notification data and user that should receive the notification. |
||
| 31 | * |
||
| 32 | * @param array $data |
||
| 33 | * @param $userId |
||
| 34 | */ |
||
| 35 | public function __construct(array $data, $userId) |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Get the channels the notification should broadcast on. |
||
| 43 | * |
||
| 44 | * @return Channel|Channel[] |
||
| 45 | */ |
||
| 46 | public function broadcastOn() |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Notification data |
||
| 53 | * |
||
| 54 | * @return array |
||
| 55 | */ |
||
| 56 | public function broadcastWith() |
||
| 63 |