(Work in progress) Please note that this package is still under development and is not ready for production use.
This package provides an MQTT broadcast channel for Laravel applications. It uses the MQTT protocol to enable real-time broadcasting of events in your Laravel application to MQTT clients.
- Send MQTT messages from your Laravel application
- Broadcast Laravel events over MQTT
You can install the package via composer:
composer require farzai/laravel-mqtt-channel
You can publish the config file with:
php artisan vendor:publish --tag="laravel-mqtt-channel-config"
This is the contents of the published config file:
return [
'default' => env('MQTT_CONNECTION', 'default'),
'connections' => [
'default' => [
'host' => env('MQTT_HOST'),
'port' => env('MQTT_PORT', 1883),
'username' => env('MQTT_USERNAME'),
'password' => env('MQTT_PASSWORD'),
],
],
];
use Farzai\MqttBroadcastChannel\MQTTChannel;
class ExampleNotification extends Notification
{
use Queueable;
public function via($notifiable)
{
return [MQTTChannel::class];
}
public function toMQTT($notifiable)
{
return [
'topic' => 'topic',
'message' => 'message',
];
}
}
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.