hamzi/portflow
PortFlow connects serial hardware (thermal printers, barcode/RFID scanners, scales, IoT boards) to Laravel via a driver-based architecture. Parse raw bytes into typed events, queue routes, and printing workflows, with Web Serial API support for browser integration.
context keys (session_id, source, device, baud_rate, device_name) — reject arbitrary keys that could be used for privilege escalation ([#security])/dev/ttyXxx, /dev/serial/by-id/*, /dev/serial/by-path/*) — prevent path traversal via /dev/shm/ or similar writable pathsIP + user ID — prevents single-IP bypass from shared/proxied networksSerialDriver implementation, or non-existent event/model classes in portflow.mappings now throw PortFlowException immediately at boot rather than failing silently at runtime[@method](https://github.com/method) PHPDoc annotations (ingest, encode, print, health) for IDE completion and PHPStan level 8 compatibilityinvalidDriver() and invalidConfiguration() for typed configuration errorsSerialEvent interface is now enforced — events not implementing SerialEvent are rejected with Log::error and routing is skipped (previously only logged a warning and continued)Log::warning on checksum mismatch to surface corrupted packets; clarified that base64 cache storage is intentional for binary-safe serialisation; fixed unpack() return type handling to prevent silent offset errorsoptionString() / argumentString() helpers — eliminates unsafe (string) casts on mixed option/argument values (PHPStan level 8 compliance)BarcodeLineDriverTest (11 test cases): single/multi barcode, custom delimiter, prefix stripping, empty line filtering, encode round-trip, field assertionsRfidAsciiDriverTest (11 test cases): STX/ETX parsing, uppercase toggle, custom delimiters, empty tag filtering, partial frame buffering, encode round-tripFingerprintPacketDriverTest (13 test cases): command/ack/data/end-data packets, checksum validation, garbage discarding, custom start code, encode round-trip, field assertionsFrameRoutingIntegrationTest (8 test cases): full ingest → event dispatch pipeline for raw-json/barcode-line/rfid-ascii/escpos drivers, SerialEvent enforcement, buffer persistence across split requests, context key whitelisting, queue routing, health endpoint, encode helperTest count: 19 → 86 tests, 172 assertions
unpack() results guarded against false returnchr() arguments explicitly narrowed to int<0, 255> with & 0xFFbold, underline, align, divider), PortFlowException, clean unit tests, README overhaulRawJsonDriver, EscPosDriver, Rs232DriverPortFlowBridge), Livewire components, ESC/POS printing engineHow can I help you explore Laravel packages today?