mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
40 lines
791 B
PHP
40 lines
791 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Events;
|
||
|
|
|
||
|
|
use App\Models\Device;
|
||
|
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
||
|
|
use Illuminate\Broadcasting\PrivateChannel;
|
||
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
||
|
|
use Illuminate\Queue\SerializesModels;
|
||
|
|
|
||
|
|
class PollingDevice
|
||
|
|
{
|
||
|
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @var \App\Models\Device
|
||
|
|
*/
|
||
|
|
public $device;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Create a new event instance.
|
||
|
|
*
|
||
|
|
* @return void
|
||
|
|
*/
|
||
|
|
public function __construct(Device $device)
|
||
|
|
{
|
||
|
|
$this->device = $device;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get the channels the event should broadcast on.
|
||
|
|
*
|
||
|
|
* @return \Illuminate\Broadcasting\Channel|array
|
||
|
|
*/
|
||
|
|
public function broadcastOn()
|
||
|
|
{
|
||
|
|
return new PrivateChannel('channel-name');
|
||
|
|
}
|
||
|
|
}
|