Undefined array key "qos"
My code
use Salman\Mqtt\MqttClass\Mqtt;
public function SubscribetoTopic()
{
$mqtt = new Mqtt();
$client_id = '123';
$topic ='testdata1';
$mqtt->ConnectAndSubscribe($topic, function($topic, $msg){
echo "Msg Received: \n";
echo "Topic: {$topic}\n\n";
echo "\t$msg\n\n";
}, $client_id);
}
I am using the package - salmanzafar/laravel-mqtt
composer require salmanzafar/laravel-mqtt
and I have inserted the above code in controller and getting error in MqttService vendor/salmanzafar/ laravel-mqtt / src/ MqttClass/MqttService.php: 273
I am using, Laravel : 10.3.2 php : 8.1 package "salmanzafar/laravel-mqtt": "^2.0"