| Total Complexity | 3 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class AnalyticTracked implements ShouldBroadcast |
||
| 12 | { |
||
| 13 | use Dispatchable, InteractsWithSockets, SerializesModels; |
||
|
|
|||
| 14 | |||
| 15 | public $basename; |
||
| 16 | public $item; |
||
| 17 | public $itemId; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Create a new event instance. |
||
| 21 | * |
||
| 22 | * @return void |
||
| 23 | * @param mixed $item |
||
| 24 | * @param mixed $basename |
||
| 25 | */ |
||
| 26 | public function __construct($basename, $item) |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Get the channels the event should broadcast on. |
||
| 35 | * |
||
| 36 | * @return \Illuminate\Broadcasting\Channel|array |
||
| 37 | */ |
||
| 38 | public function broadcastOn() |
||
| 39 | { |
||
| 40 | return new PresenceChannel('analytics.'.$this->basename.'.'.$this->itemId); |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Get the data to broadcast. |
||
| 45 | * |
||
| 46 | * @return array |
||
| 47 | */ |
||
| 48 | public function broadcastWith() |
||
| 56 | ]; |
||
| 57 | } |
||
| 59 |