webman-tech/common-utils
A collection of common utility helpers for the webman PHP framework, providing reusable tools to simplify everyday development tasks. Designed for webman-tech projects, it offers practical shared functions and classes that reduce boilerplate and keep application code cleaner and more consistent.
Request/Response/Session/Route/Config/Runtime, plus BaseMiddleware and a Json encoder that handles NaN/INF/non-UTF-8. Even if we don't adopt it, it de-risks our own scoping estimate and gives us a checklist of the edge cases (path resolution in CLI, env read-only semantics, test isolation) that internal designs routinely miss.Testing\Factory::registerTestRuntime() with TestRequest/TestRoute/TestConfig fakes means business logic can be unit-tested without booting a framework. That is a measurable reduction in test runtime and flakiness, and it's an argument for pushing business logic behind the abstraction rather than into controllers.base_path() / runtime_path() / logger() / config() helpers eliminate a class of "works in HTTP, breaks in CLI/cron" bugs — relevant if we run queue workers, scheduled jobs, or artisan-style scripts against the same codebase.Consider it when:
Look elsewhere (or treat as read-only reference) when:
Request::getCurrent() indirection is a small ongoing tax on readability and debugging.Net recommendation: adopt the pattern, not the dependency. Vendor or fork it under our namespace, pin it, and treat it as internal code — or reimplement the small surface we actually need. Track the upstream monorepo (webman-tech/components-monorepo) rather than this split, since that's where activity would appear.
To executives — one paragraph: This is a portability layer that lets the same PHP application code run on two different frameworks without a rewrite. The strategic value is optionality: it keeps a future framework migration, acquisition integration, or multi-customer deployment from becoming a multi-sprint project, and it lets us ship a single plugin to a wider customer base instead of maintaining parallel versions. The tradeoff is that the specific package is unproven — zero external users, a read-only snapshot from a monorepo, no support path. So the recommendation is not "buy this product." It's "adopt this architecture, at a cost of roughly one to two weeks of engineering, on the one or two components where portability is a real near-term requirement." That buys the option cheaply and commits us to nothing.
To engineering — the pitch:
Runtime plus Request/Response/Config/Route — replaces direct framework calls, so business logic stops importing \Webman\Http\Request or request().BaseMiddleware runs on both Webman and Laravel, and mutations via withHeaders()/withCustomData() write through to the real request, so there's no shadow-object confusion.Json::encode() is a strict improvement over json_encode() for anything user-facing — it survives NaN/INF and non-UTF-8 instead of silently returning false.RuntimeCustomRegister::register([...]) makes base_path()/runtime_path()/logger() work outside a request context, which is exactly where framework helper functions fall over.clear() in beforeEach to avoid cross-test pollution.vendor/ under our namespace, pin the version, own a thin test suite around the surface we actually use, and don't pretend upstream owes us anything. If a maintained alternative appears, swapping back is cheap because the interface is the contract.How can I help you explore Laravel packages today?