added example of facade in readme
This commit is contained in:
parent
d2c6beb3d9
commit
ffbea3d2ad
16
Readme.md
16
Readme.md
|
|
@ -45,7 +45,23 @@ public function SendMsgViaMqtt($topic, $message)
|
|||
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
|
||||
|
||||
# Full documentation Coming Soon
|
||||
|
|
|
|||
Loading…
Reference in New Issue