Total Complexity | 3 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | class ConsoleLogEvent implements ShouldBroadcastNow, ImplementsDynamicEcho, HasDynamicChannelFormula |
||
20 | { |
||
21 | use Dispatchable; |
||
22 | use InteractsWithSockets; |
||
23 | use BaseDynamicChannelFormula; |
||
|
|||
24 | |||
25 | public int $userId; |
||
26 | |||
27 | /** |
||
28 | * A message text string for the console log notification. |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | public string $message; |
||
33 | |||
34 | public function __construct(string $message) |
||
40 | } |
||
41 | |||
42 | public static function getChannelParametersClassname(): string |
||
43 | { |
||
44 | return PrivateUserChannelParameters::class; |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Get the JS callback for this event. |
||
49 | * |
||
50 | * In this case, we're just shoving a message into console.log. |
||
51 | * |
||
52 | * @return string |
||
53 | */ |
||
54 | public static function getEventJSCallback(): string |
||
57 | (e) => { |
||
58 | console.log(e.message); |
||
63 |