{"id":19719538,"url":"https://github.com/denherrring/laravel-mqtt-client","last_synced_at":"2026-05-16T07:12:40.690Z","repository":{"id":56965450,"uuid":"186393760","full_name":"DenHerrRing/laravel-mqtt-client","owner":"DenHerrRing","description":"A simple Laravel 5 Library / Client to connect/publish to MQTT broker","archived":false,"fork":false,"pushed_at":"2019-05-14T15:27:27.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T17:44:15.910Z","etag":null,"topics":["laravel","laravel-mqtt","laravel-mqtt-client","laravel-mqtt-library","laravel5","mqtt-laravel","mqtt-laravel-publisher","mqtt-laravel-subscriber"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/denherrring/laravel-mqtt-client","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DenHerrRing.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-13T09:59:39.000Z","updated_at":"2019-07-10T01:59:20.000Z","dependencies_parsed_at":"2022-08-21T06:10:25.200Z","dependency_job_id":null,"html_url":"https://github.com/DenHerrRing/laravel-mqtt-client","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenHerrRing%2Flaravel-mqtt-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenHerrRing%2Flaravel-mqtt-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenHerrRing%2Flaravel-mqtt-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenHerrRing%2Flaravel-mqtt-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DenHerrRing","download_url":"https://codeload.github.com/DenHerrRing/laravel-mqtt-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241040523,"owners_count":19898887,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","laravel-mqtt","laravel-mqtt-client","laravel-mqtt-library","laravel5","mqtt-laravel","mqtt-laravel-publisher","mqtt-laravel-subscriber"],"created_at":"2024-11-11T23:08:43.776Z","updated_at":"2026-05-16T07:12:40.661Z","avatar_url":"https://github.com/DenHerrRing.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel MQTT Client Package\n\nA simple Laravel 5 Library / Client to connect/publish to MQTT broker\n\nBased on [bluerhinos/phpMQTT](https://github.com/bluerhinos/phpMQTT)\n\n## Installation\n```\ncomposer require denherrring/laravel-mqtt-client\n```\n## Features\n\n* Name and Password Authentication\n* Certificate Protection for end to end encryption\n* Enable Debug mode to make it easier for debugging\n* Use LWT Messages and Retrain / QOS Flags\n\n## Enable the package (Optional)\nThis package implements Laravel auto-discovery feature. After you install it the package provider and facade are added automatically for laravel \u003e= 5.5.\n\n__This step is only required if you are using laravel version \u003c5.5__\n\nTo declare the provider and/or alias explicitly, then add the service provider to your config/app.php:\n\n```\n'providers' =\u003e [\n\n        DenHerrRing\\MqttClient\\MqttClientServiceProvider::class,\n];\n```\nAnd then add the alias to your config/app.php:\n```\n'aliases' =\u003e [\n\n       'MqttClient' =\u003e DenHerrRing\\MqttClient\\Facades\\MqttClient::class,\n];\n```\n## Configuration\nPublish the configuration file\n```\nphp artisan vendor:publish --provider=\"DenHerrRing\\MqttClient\\MqttClientServiceProvider\"\n```\n## Config/mqttclient.php\n```\n    'host'     =\u003e env('mqtt_host','127.0.0.1'),\n    'clientId' =\u003e env('mqtt_clientId', null),\n    'password' =\u003e env('mqtt_password',''),\n    'username' =\u003e env('mqtt_username',''),\n    'certfile' =\u003e env('mqtt_cert_file',''),\n    'port'     =\u003e env('mqtt_port','1883'),\n    'debug'    =\u003e env('mqtt_debug',false) //Optional Parameter to enable debugging set it to True\n```\n#### Publishing topic\n\n```\nuse DenHerrRing\\MqttClient\\MqttClientClass\\MqttClient;\n\npublic function SendMsgViaMqtt($topic, $message)\n{\n        $mqtt = new MqttClient();\n        $output = $mqtt-\u003eConnectAndPublish($topic, $message);\n\n        if ($output === true)\n        {\n            return true;\n        }\n\n        return false;\n}\n```\n#### Publishing topic using Facade\n\n```\nuse MqttClient;\n\npublic function SendMsgViaMqtt($topic, $message)\n{\n        $output = MqttClient::ConnectAndPublish($topic, $message);\n\n        if ($output === true)\n        {\n            return true;\n        }\n\n        return false;\n}\n```\n### Tested on php 7.3 and laravel 5.7 and also laravel 5.8\n\n## Subscription Part is in development\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenherrring%2Flaravel-mqtt-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenherrring%2Flaravel-mqtt-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenherrring%2Flaravel-mqtt-client/lists"}