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
Foundry Bundle

Foundry Bundle Laravel Package

icanhazstring/foundry-bundle

Symfony bundle that integrates Foundry's PHP object factories into your app, giving you container-aware configuration for building test fixtures and model instances with less boilerplate. Use it to wire foundries as services and keep fixture setup clean and reusable across tests. Ideal for Symfony p...

View on GitHub
Deep Wiki
Context7

Foundry Bundle integrates the Foundry object-factory library into your PHP application, letting you define reusable factories for test data and domain objects. Register factories as services and let the container wire them, so tests stay readable and free of hand-written fixture setup.

Factories stay framework-agnostic while gaining autoconfiguration, tagged services and sensible defaults for building complex object graphs.

  • Autoconfigured factory registration via the service container
  • Tagged services for easy discovery and injection
  • Framework-agnostic factory definitions
  • Sensible defaults that cut fixture boilerplate
Frequently asked questions about Foundry Bundle
Is icanhazstring/foundry-bundle compatible with Laravel?
No. It is a Symfony bundle built around a Bundle subclass and dependency-injection compiler passes, so it has no Laravel service provider, facade, or Eloquent integration. A Laravel application has nothing to register or boot from this package. For Laravel test data, use Eloquent model factories with Pest or PHPUnit and database transactions instead.
What does icanhazstring/foundry-bundle actually do?
It adds configuration nodes and compiler passes intended to auto-register or auto-tag zenstruck/foundry factory services and smooth over common wiring problems. The value is narrow and aimed at older Foundry setups where factories needed manual service configuration. Much of that behavior was later absorbed into Foundry's own bundle configuration.
Which Symfony and PHP versions does foundry-bundle support?
The last release was 2021-08-26, and its Composer constraints likely target PHP 7.x or 8.0 with Symfony 4 or 5. A modern stack on PHP 8.2 or 8.3 and Symfony 6 or 7 will probably need widened constraints in a fork. Check the exact composer.json before planning any adoption.
How do I install icanhazstring/foundry-bundle?
In a Symfony application, run composer require icanhazstring/foundry-bundle and enable the bundle in config/bundles.php. There is no Laravel package discovery or service provider, so installing it in Laravel will not register anything useful. Review the version constraints first because the package predates current Symfony and PHP releases.
Does foundry-bundle work with zenstruck/foundry 2.x or 3.x?
It was built for Foundry 1.x-era factory service wiring, and there is no evidence of support for Foundry 2.x or 3.x. Foundry later gained native configuration and autoconfiguration that cover much of what this bundle added. If you experiment, add conflict rules and verify that the Symfony container still compiles.
What problems do the compiler passes in foundry-bundle solve?
They are meant to auto-tag or register Foundry factory services and apply sensible defaults so factories do not need manual service definitions. That helps legacy Symfony apps pinned to older Foundry releases. Before adopting, compare each pass against native Foundry bundle config such as autoconfiguration and persistence reset helpers.
Is icanhazstring/foundry-bundle actively maintained?
No. The last release was August 2021, and the repository shows zero stars and zero dependents, which signals an unmaintained single-author artifact. MIT licensing means you can fork it, but there is no security disclosure or patch channel. Treat adoption as taking ownership of a fork.
What are the alternatives to foundry-bundle for Symfony test fixtures?
Use native zenstruck/foundry bundle configuration, dama/doctrine-test-bundle for database isolation, and DoctrineFixturesBundle or Alice when you need shared fixtures. If you truly need custom factory registration, write a small in-house compiler pass you control. For Laravel, the equivalent is Eloquent factories plus RefreshDatabase or DatabaseTransactions.
Can I use foundry-bundle in production?
It is test and development tooling, so it should be require-dev only rather than a production runtime dependency. Compiler passes execute during cache warmup, meaning a Symfony minor upgrade can break container compilation with no upstream fix. Keep it out of production builds and plan to remove it.
How do I migrate away from foundry-bundle?
Audit each compiler pass and document its behavior in one line. Compare that behavior with native Foundry config on your pinned version, then replace it with native configuration or roughly 20 lines of in-house PassConfig code you own. Remove the Composer dependency once container compilation and the test suite pass.
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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
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