⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.101
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
Server Software:
Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.25
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
taxi.dev-unit.com
/
app
/
Jobs
/
View File Name :
NotifyViaMqtt.php
<?php namespace App\Jobs; use ElephantIO\Client; use Illuminate\Bus\Queueable; use Illuminate\Support\Facades\Log; use Illuminate\Queue\SerializesModels; use Illuminate\Queue\InteractsWithQueue; use ElephantIO\Engine\SocketIO\Version2X; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; use Salman\Mqtt\MqttClass\Mqtt; class NotifyViaMqtt //implements ShouldQueue { // use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; protected $event_name; protected $message; protected $client_id; /** * Create a new job instance. * * @return void */ public function __construct($event_name, $message, $client_id) { $this->event_name = $event_name; $this->message = $message; $this->client_id= $client_id; } /** * Execute the job. * * @return void */ public function handle() { try { $mqtt = new Mqtt(); $output = $mqtt->ConnectAndPublish($this->event_name, $this->message, $this->client_id); Log::info($output); } catch (\Expection $e) { Log::error($e); } } }