Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Factory Laravel Package

yiisoft/factory

A flexible factory for Yii3 that creates objects from class names, definitions, or callables, resolving constructor dependencies through a PSR-11 container. Ideal for configurable services and dependency injection setups.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Framework-agnostic package strategy. If your roadmap includes publishing reusable PHP libraries (SDKs, domain modules, CLI tooling) that must run on Laravel and other frameworks, this package provides reflection-based object construction against any PSR-11 container — a genuine portability primitive.
  • Build vs. buy for DI plumbing. The package is a thin, single-purpose utility (BSD-3, ~tiny surface area). The realistic decision is not "buy vs. build" but "adopt vs. ignore" — reimplementation is a day of work, so treat it as a low-stakes convenience rather than a strategic dependency.
  • Dependency-footprint governance. Useful as a reference when auditing transitive dependencies of Yii-derived code you inherit, or when deciding whether to allow framework-coupled containers into shared packages.
  • Roadmap triage. With 36 stars and an opportunity score of ~1.16, this is not a candidate for a modernization or standardization initiative. Log it as "known utility, evaluate on demand" rather than plan work around it.
  • Ecosystem signal. Confirms Yii's continued investment in PSR-standard interop (recent 2025-12 release), which matters if you have Yii services in the estate.

When to Consider This Package

Consider it when:

  • You are building or maintaining a framework-agnostic PHP library that needs constructor-injection without depending on Illuminate\Container or Symfony's container.
  • You are already in the Yii ecosystem — this is a native primitive there, and adopting it aligns with the surrounding stack.
  • You need a minimal, auditable instantiation layer where a full container (Symfony DI, PHP-DI, Laravel) would be overkill or would create a hard framework lock-in.
  • You want a PSR-11-compliant seam so the underlying container can be swapped later.

Look elsewhere when:

  • You are in a Laravel application — app()->make() and Laravel's container already do reflection-based autowiring, contextual binding, and attribute-driven injection. Adding this creates a second DI path with no upside.
  • You need advanced DI features: compiled containers, lazy proxies, tagged services, contextual/scoped bindings, or PHP attributes for injection. PHP-DI, Symfony DI, or Laravel's container are the right tools.
  • Community support and longevity are required — 36 stars and framework-driven maintenance mean you own the risk if the Yii project deprioritizes it.
  • You need service providers, bootstrapping, or lifecycle hooks; this package deliberately does none of that.

How to Pitch It (Stakeholders)

To executives: This is a small, permissively licensed (BSD-3) utility from the Yii project that helps construct PHP objects using standard container interfaces. It carries negligible cost and low risk, but also low leverage — our adoption signal (36 stars, weak opportunity score) says it will not move business metrics. Recommendation: do not fund adoption as an initiative. Sanction it only as an allowed dependency for framework-agnostic libraries, where it replaces bespoke glue code with a maintained standard.

To engineering: It is a reflection-based factory that resolves constructor dependencies from any PSR-11 container — conceptually the autowiring half of Laravel's container, minus bindings, providers, and lifecycle. In a Laravel codebase it is redundant and should be rejected; maintain one DI path. In shared libraries or non-Laravel services, it is a clean, dependency-light seam that keeps you off Illuminate\Container. Caveats: small maintainer base, no advanced DI features, and an implicit expectation that you own the integration. Approve for library code with a clear owner; block for application code.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle