itsgoingd/slim-facades
Bring Laravel-style facades to Slim Framework. slim-facades adds a lightweight facade layer and service container integration, letting you access container-bound services through clean static interfaces in your routes and controllers, with minimal setup and no framework overhaul.
Architecture fit. slim-facades layers a Laravel-style static façade API over Slim's container (Slim 3's $app->getContainer() / PSR-11 access). It is not a framework, router, or middleware library — it is a thin syntactic convenience layer that resolves container keys via a statically registered container (Facade::setFacadeContainer()), with a companion middleware to bind the per-request instance. Architecturally it fits only if the team has already committed to Slim and wants Laravel-shaped call sites (Router::get(...), View::render(...), Log::info(...), Request::getParam(...)) instead of constructor injection. It is a poor fit for greenfield work where explicit DI, PSR-11 typing, and testable boundaries are the norm; the façade indirection actively pushes against that.
Integration feasibility. Low effort to adopt mechanically: one composer require, one bootstrap line to register the container, optionally one middleware added to the stack. No schema, no config tree, no service provider contract. The real cost is not installation but the discipline it erodes — static calls bypass the container graph, so dependency visibility and IDE-level traceability degrade immediately.
Technical risk.
Request/Response accessors to be semantically wrong (mutable $request->getParam() assumptions, no response object to mutate). Verify composer.json constraints before anything else.Request:: from a domain service, at which point unit tests require bootstrapping a container — a classic testability regression.Key questions.
Stack fit. Best fit: Slim 3 + a Laravel-influenced team porting patterns or building an internal admin/API service where developer velocity matters more than architectural purity. Poor fit: Slim 4, or any codebase with an enforced "constructor injection only" standard. Confirm PHP version alignment with Slim's own constraints, and confirm the PSR-11 container used (Pimple in Slim 3, PHP-DI/League\Container commonly in Slim 4) exposes the keys the façades expect — router, view, logger, settings, request, response.
Migration path. Introduce behind a boundary: allow façades in the HTTP edge layer (routes, controllers, middleware) and forbid them below it (domain, repositories, services). Enforce mechanically with a PHPStan/Psalm rule or a simple grep-based CI check. This gives you the ergonomic win without the testability debt. If you later need to remove the package, the migration is a bounded refactor of the edge layer only.
Compatibility. Verify the package's Slim constraint against your pinned version first — this is a go/no-go gate, not a detail. Then verify container key names match your bootstrap (the façades resolve by key, so a renamed service silently breaks at runtime, not at install). Check interaction with any existing middleware that replaces or wraps the request object; the façade middleware must sit at a position where it sees the request you actually want to expose.
Sequencing.
Maintenance. Very low ongoing maintenance from you — no config, no migrations, no background jobs. The dependency itself is the maintenance question: with a single maintainer and low activity, plan for the realistic possibility of pinning a version indefinitely or vendoring the ~small source into your repo. Budget a periodic compatibility check on every Slim major bump.
Support. No commercial backing, no SLA. Internal support means one or two engineers who understand the façade-to-container resolution; document the bootstrap line and the middleware position, because misordering it produces confusing null-request failures that look like framework bugs.
Scaling. Horizontally neutral — it adds no I/O, no state store, no network hop. Per-request overhead is a static lookup. The scaling concern is vertical/runtime-shaped, not load-shaped: under RoadRunner/Swoole the static container is a correctness risk under concurrency, so scaling the runtime model forces you to solve state rebinding first.
Failure modes.
Ramp-up. Near zero for engineers with Laravel experience — the idiom is identical. For engineers without it, expect a short but real adjustment: the façade looks like a global, so the "where does this actually come from" question recurs. Mitigate with a one-page internal standard (which façades are permitted, where, and why domain code must not use them) rather than relying on code review alone. Net: adoption cost is low, but the governance cost is non-zero and must be paid deliberately or the package quietly undermines the container architecture it sits on.
How can I help you explore Laravel packages today?