added example of facade in readme

This commit is contained in:
Salman Zafar 2019-02-27 12:31:04 +05:00
parent d2c6beb3d9
commit ffbea3d2ad
1 changed files with 16 additions and 0 deletions

View File

@ -45,7 +45,23 @@ public function SendMsgViaMqtt($topic, $message)
return false; return false;
} }
``` ```
#### Publishing topic using Facade
```
use Mqtt;
public function SendMsgViaMqtt($topic, $message)
{
$output = Mqtt::ConnectAndPublish($topic, $message);
if ($output === true)
{
return true;
}
return false;
}
```
### Tested on php 7.3 and laravel 5.7 ### Tested on php 7.3 and laravel 5.7
# Full documentation Coming Soon # Full documentation Coming Soon