wikimedia/object-factory
Wikimedia ObjectFactory builds PHP objects from declarative specifications, mapping class names, constructor arguments, and factory callables to instances. Lightweight, dependency-free, and used by Wikibase and other Wikimedia projects.
Architecture fit. wikimedia/object-factory is a framework-agnostic PHP utility that turns declarative configuration arrays into instantiated objects (class name, constructor args, fluent calls, and optional service injection). It is not a Laravel package: there is no service provider, facade, config stub, or container contract integration. Its core job — resolving a class name plus arguments into an object — overlaps almost entirely with Laravel’s service container. The genuine gap it fills is narrow: a config-driven plugin/strategy registry where administrators or config files name concrete classes and their constructor arguments, and you want that resolved without writing a bespoke resolver. For a typical Laravel app, that is a convenience, not a capability the framework lacks.
Integration feasibility. Technically trivial. composer require the package, and you can call its factory from anywhere; a thin wrapper (a Laravel service provider binding a singleton, plus a config schema) is a half-day of work. No bootstrapping conflicts, no global state, no framework hooks. The risk is not "can we integrate it" but "should we."
Technical risk.
Key questions.
app()->makeWith(), contextual bindings, tagged bindings) cover 90% of the need with a ~50-line custom resolver?calls/service-injection semantics, or only class + args?Stack fit. Compatible with modern PHP/Composer and coexists with Laravel without conflict, but it sits beside the container rather than inside it. Any adoption requires an explicit decision about which resolver owns instantiation — you do not want two competing object-construction paths in one codebase.
Migration path. There is no migration path from anything, because nothing depends on it. The realistic path is greenfield: introduce it for a new config-driven subsystem (e.g., selectable export formats, webhook handlers, payment adapters) rather than retrofitting existing new/container calls. Retrofitting would be churn with no functional gain.
Compatibility. Verify the tag’s PHP constraint against the application’s floor, and confirm autoloading and any transitive Wikimedia dependencies are acceptable under the same license review. Because it has no Laravel integration, there is no version-matrix risk against the framework itself — only against PHP.
Sequencing.
app()->makeWith(). If it satisfies the requirement, stop — the dependency adds license and governance cost for no functional gain.Maintenance. Upstream moves at Wikimedia’s cadence, gated by MediaWiki’s release cycle; security fixes arrive on that schedule, not ours. The mirror is read-only, so we cannot patch upstream and must either wait or maintain a local fork (with the GPL obligations that implies). Budget for periodic manual review of Gerrit activity, since Composer will not surface advisories for a package this small.
Support. No commercial support, no vendor, no meaningful community. Internal staff become the support tier. Onboarding documentation will have to be written in-house.
Scaling. Runtime cost is negligible — it is reflection/instantiation, not a hot path. The operational scaling concern is cognitive: config-driven object graphs become hard to trace as the config surface grows, and IDE navigation ("where is this class instantiated?") degrades. Keep the config surface small and schema-validated.
Failure modes.
Ramp-up. Engineer ramp-up is low — the API is small and the concept familiar to anyone who has used a DI container. Organizational ramp-up is the real cost: every new contributor must learn "this one subsystem resolves objects differently from the rest of the app," and legal must re-clear the dependency at each acquisition or distribution event.
TPM recommendation. Treat as evaluate-and-hold. Score 0.025 with 0 dependents and a GPL-2.0 license is a defensible "no" for a Laravel codebase unless a concrete, recurring config-driven plugin requirement exists and the container-native alternative has been explicitly rejected. If adopted, it should be a single, wrapped, version-pinned dependency — never a pattern the team is encouraged to reach for generally.
How can I help you explore Laravel packages today?