You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update composer packages and untrack composer.lock
* Update code and config for v1.0.0-rc1
* Use contract instead of implementation
* Update README.md
and change the configuration in `config/mqtt-client.php` according to your needs.
25
29
26
30
## Configuration
27
31
28
-
The package allows you to configure multiple named connections. An initial example
29
-
can be found in the published configuration file. Except for the `host` parameter,
30
-
all configuration options are entirely optional and come with the defaults provided
31
-
to the `env()` helper in the example configuration file (no default means `null`).
32
+
The package allows you to configure multiple named connections. An initial example with inline documentation can be found in the published configuration file.
33
+
Most of the configuration options are optional and come with sane defaults (especially all of the `connection_settings`).
32
34
33
-
An example configuration of two connections, where one is meant for sharing public
34
-
data and one for private data, could look like the following:
35
+
An example configuration of two connections, where one is meant for sharing public data and one for private data, could look like the following:
35
36
```php
36
37
'default_connection' => 'private',
37
38
@@ -48,6 +49,8 @@ data and one for private data, could look like the following:
48
49
```
49
50
In this example, the private connection is the default one.
50
51
52
+
_Note: it is recommended to use environment variables to configure the MQTT client. Available environment variables can be found in the configuration file._
53
+
51
54
## Usage
52
55
53
56
### Publish (QoS level 0)
@@ -59,53 +62,64 @@ use PhpMqtt\Client\Facades\MQTT;
59
62
MQTT::publish('some/topic', 'Hello World!');
60
63
```
61
64
62
-
If needed, the connection name can be passed as third parameter:
65
+
If needed, the _retain_ flag (default: `false`) can be passed as third and the connection name as fourth parameter:
0 commit comments