- How do I install PortFlow in a Laravel application?
- Install the package with Composer using composer require hamzi/portflow, then publish its configuration file so you can define drivers, queue routing, and Web Serial settings per environment. PortFlow requires PHP 8.2 or newer and Laravel 11, 12, or 13. After publishing, register your device drivers and expose the Blade or Livewire connector components in the views where hardware interaction happens.
- Which Laravel and PHP versions does PortFlow support?
- PortFlow supports Laravel 11, 12, and 13 on PHP 8.2 through 8.4. The CI pipeline runs both prefer-lowest and prefer-stable dependency matrices across PHP 8.2, 8.3, and 8.4. That prefer-lowest pass is useful evidence if you pin dependencies tightly in an enterprise lockfile-heavy stack.
- Does PortFlow work in all browsers?
- No. Real hardware I/O depends on the browser's Web Serial API, which is currently available only in Chrome and Edge. Cross-browser support is an unresolved product constraint rather than a package defect, so plan your user-facing hardware workflows around a Chromium-based browser. A backend direct serial mode exists, but serial access still fundamentally originates from a browser or a proxy.
- How can I test PortFlow without physical hardware?
- Version 0.9.0 adds the portflow:simulate command, which lets you replay payloads through the driver and event pipeline without attaching a device. This reduces the cost of iterating on hardware-specific drivers and validating routing logic before deployment. The package itself ships with 122 tests at a 100 percent pass rate, which you can use as a reference for your own integration tests.
- How do I create a custom driver for an unsupported device?
- Run the portflow:make-driver command to scaffold a class that implements the SerialDriver contract, then register it with the DriverRegistry and reference it in your configuration. Version 0.9.0 fixed a namespace path resolution bug in the scaffolding command, so any drivers generated under earlier versions may carry a broken namespace and should be regenerated or corrected manually. Custom drivers still require device-specific parsing work; the simulate command only lowers the cost of iterating on that logic.
- How does PortFlow route hardware events into Eloquent models?
- Incoming serial frames are decoded by a driver into DTOs and dispatched as Laravel events, which you can listen for to persist data into Eloquent models. Routing can be synchronous or pushed onto a queue using the configurable queue.connection and queue.name settings. This keeps your ingest controllers thin and lets you apply the same event-driven pattern across printers, scales, sensors, and scanners.
- What production settings should I review before deploying PortFlow?
- Review queue.connection and queue.name so PortFlow runs on a dedicated queue with provisioned worker capacity, which matters for multi-tenant and high-throughput deployments. Also set the WebhookDriver HTTP request timeout, since the configurable timeout closes a worker-starvation risk when downstream endpoints hang. Treat these as per-environment configuration that must be governed in version control alongside your other deployment settings.
- What does portflow:health do and should I wire it into deployment probes?
- The portflow:health command performs subsystem validation of the package's drivers, configuration, and routing setup. Because it returns a pass or fail signal, it can be wired into container liveness and readiness probes or used as a post-deploy gate in your pipeline. Running it as a scheduled check is also reasonable if you prefer not to block deploys on hardware-dependent validation.
- How do I clear stale IoT frame buffers in PortFlow?
- Use the portflow:purge-buffers command for targeted invalidation, or call the clearBuffer method programmatically when you know a specific device's cached frames are stale. This avoids flushing the entire cache store and the side effects that come with it. Buffer persistence across requests is a supported feature, so stale state is a real operational scenario rather than a bug.
- Can PortFlow be used for API-only or CLI-only hardware integrations?
- Not directly. Real hardware I/O still requires browser-side JavaScript through the Web Serial API, so server-rendered or headless integrations remain blocked out of the box. If you need fully server-side serial access, introduce a proxy such as a Node serialport service and have PortFlow talk to it over HTTP. The simulate and health commands help you validate the surrounding pipeline even when no physical device is attached.