I try to subscribe to a topic, I get below mentioned error:
Undefined array key "qos"
My code:
`try {
$mqtt = new Mqtt();
$mqtt->ConnectAndSubscribe('myTopic', function ($topic, $msg) {
Log::info("Mqtt Msg Received");
});
} catch (\Exception $e) {
dd($e->getMessage());
}`
(As in the example, I inserted it into a controller).
$buffer .= chr($callback["qos"]);
in vendor/salmanzafar/laravel-mqtt/src/MqttClass/MqttService.php:173
If I solve the problem adding a simple "?? 0", when I try to subscribe, it doesn't seems to work.
I'm using Laravel 8.16 with PHP 8.0 and "salmanzafar/laravel-mqtt": "^2.0".