added example of facade in readme
This commit is contained in:
1 parent
d2c6beb3d9
commit
ffbea3d2ad
1 file changed
+16
@@ -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
|
||||||
Reference in new issue
Block a user