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
Service Factory Bundle

Service Factory Bundle Laravel Package

svb/service-factory-bundle

svb/service-factory-bundle is a PHP bundle that provides a centralized service factory for constructing and wiring services, helping organize object creation and dependency configuration in Symfony applications.

View on GitHub
Deep Wiki
Context7

Convenient way to automatically inject services into a factory without using sf service tagging.

Frequently asked questions about Service Factory Bundle
Is svb/service-factory-bundle compatible with Laravel?
No. svb/service-factory-bundle is a Symfony bundle that registers factories through Symfony's dependency injection container and compiler passes; there is no supported integration path for Laravel's container. Laravel applications should use service providers, contextual binding, and container bindings instead. Treat this repository as a Symfony-only reference, not a Composer dependency for Laravel.
What does svb/service-factory-bundle actually do?
It adds a lightweight service factory layer to Symfony applications so object construction and dependency wiring live in dedicated factory classes instead of being scattered across container configuration. Factories are registered through bundle configuration, tagged automatically, and resolved like other Symfony services. The bundle also supports constructor arguments, named service resolution, and PSR-11 container access inside factories.
How do I install svb/service-factory-bundle in a Symfony project?
Install it with Composer, register the bundle in config/bundles.php, and declare your factory services through the bundle configuration. Because the package has little public usage evidence, pin an exact version and confirm the required Symfony and PHP constraints in composer.json before adoption. After installation, boot the kernel and instantiate at least one factory in a smoke test.
Which Symfony and PHP versions does svb/service-factory-bundle support?
The available assessment does not show a proven CI matrix against current Symfony or PHP releases, so do not assume Symfony 7.x or PHP 8.2–8.4 support without checking. Read the composer.json constraints and run the test suite locally against your project's Symfony LTS and PHP version. Compiler-pass bundles can break at container compile time when Symfony majors change internals.
How does svb/service-factory-bundle integrate with Symfony's dependency injection container?
The bundle uses automatic service tagging and compiler-pass integration so factory classes are discovered and registered like ordinary Symfony services. Factories can receive constructor arguments and resolve named services, and they can use PSR-11 container access internally when needed. That convenience depends on Symfony internals, so verify behavior after every framework upgrade.
Can I use svb/service-factory-bundle in Laravel as a factory or service provider replacement?
No. Laravel's service container, service providers, and contextual binding already solve factory-style construction and dependency configuration without Symfony compiler passes. Grafting this bundle into Laravel would add supply-chain risk without a supported mechanism. Use Laravel-native bindings and factories instead.
How should I test factories created by svb/service-factory-bundle?
Add a CI smoke test that boots the Symfony kernel and instantiates at least one auto-injected factory, because compiler-pass failures can appear only at container compile time. The bundle's PSR-11 container access and service resolution make factories relatively easy to mock or replace in unit tests. Also verify each configured factory tag and constructor argument after Symfony upgrades.
Is svb/service-factory-bundle actively maintained and safe for production?
The assessment reports 0 stars, 0 dependents, a single-vendor origin, and no visible release cadence or community triage, which is weak production signal. If you adopt it, pin an exact version, add container-boot smoke tests, and assign a named maintainer prepared to fork it. For most teams, native Symfony features are the safer production choice.
What are the alternatives to svb/service-factory-bundle in Symfony and Laravel?
In Symfony, use native autowiring, ServiceSubscriberInterface, tagged locators, and #[AutowireLocator] rather than adding a third-party factory layer. In Laravel, use service providers, container bindings, contextual binding, and dedicated factory classes. These first-party mechanisms cover most factory-injection needs with no extra supply-chain surface.
How do I migrate away from svb/service-factory-bundle to native Symfony features?
Replace the bundle's factory registrations with native tagged locators, ServiceSubscriberInterface, or #[AutowireLocator], keeping each factory's public behavior unchanged so the change stays reversible in one pull request. Benchmark a native tagged-locator implementation against the bundle before committing to a broader rollout. For Laravel codebases, do not migrate this bundle—reimplement the pattern with Laravel service providers and container bindings.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource