Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Client

Laravel Client Laravel Package

php-mqtt/laravel-client

Laravel client for MQTT built on php-mqtt/client, making it easy to publish messages and subscribe to topics from Laravel applications. Includes configuration, a facade, and seamless integration with Laravel's container and service provider.

View on GitHub
Deep Wiki
Context7

An MQTT client library for Laravel.

Frequently asked questions about Laravel Client
What is php-mqtt/laravel-client used for?
It is a Laravel wrapper around php-mqtt/client for publishing MQTT messages and subscribing to topics from Laravel applications. It provides a configuration file, a facade, a service provider, and Artisan commands for subscribing. It is best treated as an outbound integration adapter rather than a full messaging platform. It does not provide consumer groups, offset management, or a durable subscription registry.
How do I install and configure php-mqtt/laravel-client in Laravel?
Install it with Composer using composer require php-mqtt/laravel-client. Publish the package configuration so you have config/mqtt-client.php, then set broker host, port, credentials, and TLS options through your .env file. Laravel's package discovery registers the service provider and facade automatically. After that you can publish messages through the facade or run the provided subscribe command.
Does php-mqtt/laravel-client support Laravel 13?
Yes. Version 1.8.0 adds Laravel 13.x support by widening the Composer compatibility constraint, contributed via Laravel Shift. That release has no new features, API changes, deprecations, or behavioral changes to the MQTT layer. It is a maintenance release intended to let Laravel 13 projects adopt the package without forking or pinning. Confirm the widened constraint matches your application's current Laravel version before upgrading.
How do I publish an MQTT message from Laravel with this package?
Publishing is the simple path: configure your broker connection and call the package facade with the topic and payload. Installation is Composer-only, configuration is centralized in config/mqtt-client.php, and the publish call is only a few lines. Because the package wraps php-mqtt/client, you are still working with normal MQTT client semantics rather than a queued or transactional messaging abstraction.
How do I subscribe to MQTT topics in Laravel using php-mqtt/laravel-client?
The package provides Artisan commands for subscribing, including mqtt:subscribe. You point the command at your configured broker and topics, then run it as a long-lived process. Subscription is not a request-cycle activity, so plan for a supervised worker rather than a web route or a short-lived queue job. You also need a clear policy for what happens to in-flight messages during deploys, restarts, and broker failovers.
What MQTT QoS should I use with Laravel MQTT messages?
The default QoS is typically 0, which is at-most-once delivery, so messages can be lost if the connection drops. If MQTT messages trigger business actions, raise the QoS to 1 and make downstream handlers idempotent because duplicates are possible. Decide which topics genuinely require QoS 1 rather than applying it everywhere. Document those choices alongside the subscriber process design.
How should I run the MQTT subscriber in production?
Run the subscriber as a long-running supervised process using Supervisor, systemd, or a dedicated container worker. Do not run it inside a request/response cycle or a queue worker with a short timeout, because MQTT is a stateful long-lived connection and that pattern produces silent gaps in consumption. Define restart and backoff behavior explicitly, and assign ownership of the subscriber process to a specific team. Also decide how deploys and broker failovers should handle in-flight messages.
How do I secure MQTT broker credentials and TLS with this Laravel client?
Broker credentials belong in .env and are referenced from config/mqtt-client.php, so they do not need to be hard-coded. TLS certificate and key paths must be mounted correctly in every environment, including local development and CI. Certificate rotation is a recurring operational failure source, so include it in your runbook. Treat broker access as production infrastructure rather than a one-time package configuration task.
Can I use php-mqtt/laravel-client inside Laravel queues or a request cycle?
Publishing from a queue job or request can work for short outbound messages, but subscribing should not run in a request/response cycle or a short-timeout queue worker. MQTT subscriptions depend on a persistent connection, and short-lived processes can leave silent gaps in consumption. For reliable consumption, use a supervised long-running mqtt:subscribe process. Keep the publish path and subscribe path as separate operational concerns.
What are alternatives to php-mqtt/laravel-client if it becomes unmaintained?
Because it is a thin wrapper, the exit cost is modest: you can drop down to php-mqtt/client directly and keep your broker and topic design unchanged. You could also move MQTT ownership to a dedicated broker-side service or an existing enterprise IoT or managed broker integration. The main migration work is replacing the Laravel config, facade, and Artisan subscribe command rather than rewriting MQTT logic. Before adopting it, check whether your organization already has an MQTT integration this would duplicate.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle