betalabs/engine-workflow-helper
A Laravel/PHP helper package for Betalabs Engine that provides convenient utilities for defining and managing workflow states and transitions, helping developers add structured process or approval flows to their applications with less boilerplate.
Version context: this assessment reflects v3.0.0. Compared to 2.x, the only breaking changes are platform floors — no class, constant, or payload changes.
^8.2 (built and tested against 8.5), Laravel 10/11/12, and betalabs/engine-phpsdk ^3.0. If you are on PHP 8.0/8.1, Laravel 9 or older, or pinned to engine-phpsdk 2.x, stay on 2.x — there is no partial upgrade path.composer require <vendor>/<package>:^3.0 betalabs/engine-phpsdk:^3.0
php artisan vendor:publish --tag=<package>-config
Bump engine-phpsdk explicitly rather than letting it come in transitively — a stale lockfile entry is the most common cause of a half-finished upgrade.config/ — credentials, base URL, and any dispatcher/HTTP options.AppDispatcher — the single seam through which Get/Post/Put/Delete calls leave your app. Everything you do day-to-day routes through it.Order\ steps — value objects describing the request body (e.g. Order\UpdateMultipleStatuses).tests/ — 25 tests, order-independent, covering dispatcher verbs and enums. This is the best available documentation of exact payload shapes.$step = new Order\UpdateMultipleStatuses(/* exact params — see the package test */);
$response = app(AppDispatcher::class)->post($step);
$response->successful();
Run it against a sandbox/staging credential before wiring it into a controller.Encapsulate the dispatcher behind your own service. Inject AppDispatcher into a small EngineService (or per-domain action classes) bound in a service provider. Nothing in your domain layer should resolve it via app() or touch a facade — that keeps the upgrade blast radius to one file when the next major lands.
Model each operation as a step object, not an array. The package's own tests assert the exact parameters of Order\UpdateMultipleStatuses; treat that test as the contract. When you add an operation the package doesn't ship, write your own step class in the same shape rather than assembling an ad-hoc payload in a controller. Verb selection (Get/Post/Put/Delete) belongs in the step or its factory, not at the call site.
Push dispatches onto the queue. Network-bound operations should not sit in a request cycle. A job with $tries, backoff(), and failed() handling gives you retries and observability for free. Carry your own correlation ID (order ID + operation name) through the payload and into logs — the SDK will not give you an idempotency key for free.
Use the SDK enums, not strings. The v3 test suite explicitly exercises enums for events and verbs. Stringly-typed statuses are the most likely source of silent drift between your app and the Engine; type-hint against the enum in your action signatures and let static analysis catch typos.
Listeners can now be typed properly. v3 corrected malformed and swapped event/listener docblocks. If you register listeners for package events, re-check the expected event class and payload: code that "worked" in 2.x may have been relying on an incorrect annotation that your IDE or PHPStan was quietly ignoring. After upgrading, run your analyser before assuming nothing changed.
Mirror the package's test style. The dispatcher's Get/Post/Put/Delete surface is covered by the package tests; use the same fake-HTTP approach in your app tests so you assert the outgoing payload, not just the return value. Order-independence is guaranteed in the package's suite — your own suite should not lean on shared credential or config state either.
CI matrix. Given the package targets PHP 8.5 / Laravel 12, align your matrix accordingly (8.2, highest supported, × Laravel 10/11/12). This catches the illuminate constraint conflicts described below at PR time rather than at deploy time.
illuminate/support and illuminate/http (^10||^11||^12) are now declared, where previously they were implicit. Anything in your tree that pins illuminate/* to ^9 will now conflict loudly instead of silently resolving.allow-plugins trick; plan the framework upgrade as a prerequisite, not a follow-up.php artisan config:clear (or re-run config:cache) after touching .env — a surprising number of "the SDK isn't picking up my key" reports are this.Http::fake() in tests, verify the SDK actually routes through Laravel's HTTP client rather than its own Guzzle client. If it doesn't, Http::fake() silently no-ops and your assertions pass for the wrong reason. Use the SDK's own mock handler in that case.Order\UpdateMultipleStatuses test. That test encodes the exact expected parameter set, which makes it the fastest reference when the Engine rejects a request.AppDispatcher's four verb methods are the intended seam for operations the package doesn't ship. Build small step value objects on top of them rather than reaching into the SDK directly — that keeps you inside the package's abstraction and makes the eventual 4.x migration a single-file change.How can I help you explore Laravel packages today?