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

Fixture Bundle Laravel Package

toro/fixture-bundle

Toro Fixture Bundle provides a streamlined way to define, load, and manage fixtures in PHP applications, making it easy to seed databases and keep consistent test data across development and testing workflows.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Confirm what it actually is before installing. At 0 stars, 0 dependents and a last release of 2020-04-19, the README is unverified. Open composer.json first and check three things: "type" (almost certainly symfony-bundle), the autoload.psr-4 namespace (likely Toro\FixtureBundle\), and the require block (symfony/framework-bundle, doctrine/*). Those three lines tell you whether it is usable from Laravel at all.
  • Install as a dev dependency only, in a throwaway branch so you can diff the lockfile:
    composer require --dev toro/fixture-bundle:^1.0
    # if constraints fight your PHP version, point at the tag explicitly
    composer require --dev toro/fixture-bundle:"dev-master#<2020-04-19-sha>"
    
  • Where to look first, in this order:
    1. src/*Bundle.php — the bundle class and whether it declares a container extension.
    2. src/DependencyInjection/Configuration.php and the matching *Extension.php — with no published docs, this file is the documentation. It is the only reliable list of config keys.
    3. The fixture base class/interface and its loader — the only part worth carrying into Laravel.
    4. tests/ — with no users and no docs, the tests are the specification.
  • First use case: deterministic local/CI seeding. A fixed set of records so a fresh php artisan migrate --seed yields predictable app state, reusable in tests. The test is simple: do the fixture classes have a load()-style method and plain constructor dependencies? If yes, you can call them from a seeder within minutes. If they call $container->get(...) internally, stop and pick another tool.
  • Minimal bridge:
    // database/seeders/ToroFixturesSeeder.php
    class ToroFixturesSeeder extends Seeder
    {
        public function run(): void
        {
            // only if the fixture classes are container-free
            (new \Toro\FixtureBundle\Fixture\SomeFixture())->load();
        }
    }
    

Implementation Patterns

1. Symfony app — the intended path. Register in config/bundles.php, configure under the bundle's root key, run its console command. This is the only path the package was designed for; if you are in Laravel for the long haul, this pattern is not available to you.

2. Laravel — port the definitions, not the bundle. Copy the fixture classes into database/fixtures/ or tests/Fixtures/, add a PSR-4 mapping in composer.json, and replace Symfony container lookups with constructor injection resolved by Laravel's container. This is the highest-value path: you keep the domain-shaped fixture data and discard the wiring you cannot use.

3. Laravel — use it as a plain library. Instantiate fixtures manually with no kernel, no bundle registration, no extension config. Viable only if the classes avoid Symfony\Component\* and Doctrine\* imports entirely; grep the src/ tree for both before committing.

4. Test seeding. Pair RefreshDatabase with a trait that replays the same fixture set:

trait SeedsToroFixtures {
    protected function seedFixtures(): void {
        $this->artisan('db:seed', ['--class' => ToroFixturesSeeder::class]);
    }
}

Seed any RNG (mt_srand, Faker's seed()) so failures are reproducible across runs.

5. Factories bridge. If the fixtures are essentially data arrays, feed them into Eloquent factories and let Laravel do persistence. You get relationship handling and states() for free, which the 2020-era bundle almost certainly does not have.

Integration tips

  • Guard execution: if (! app()->environment(['local', 'testing'])) { return; } — seeding is never a production operation.
  • Keep it dev-only via require-dev so it does not leak into production autoload; Laravel's package discovery is irrelevant here, so there is no dont-discover safety net.
  • Order matters. If the bundle resolves inter-fixture dependencies, preserve that ordering explicitly in your seeder rather than relying on filesystem order.

Gotchas and Tips

  • A bundle is not a Laravel package. composer require will succeed and then do nothing: Laravel's discovery reads extra.laravel, and Symfony bundles ship extra.symfony. No service provider, no publishable config, no facade.
  • Doctrine vs Eloquent. If the fixtures depend on doctrine/data-fixtures or an ObjectManager, installing doctrine/dbal is not enough — you need a second persistence layer alongside Eloquent. That mismatch alone usually kills adoption.
  • Abandoned since 2020-04-19. Expect pre-PHP-8.1 code: ReturnTypeWillChange deprecations, hard-pinned symfony/* and doctrine/* constraints that will conflict with a modern app. Pin the tag and vendor it; do not expect upstream fixes. If you need to patch, fork to a private VCS repo.
  • Bundle config never applies outside a Kernel. Extension config is processed by Symfony's container. Standalone use means defaults or manual constructor arguments — read the Extension class for hardcoded defaults before assuming your YAML/PHP config took effect.
  • Service IDs are strings. Any internal $container->get('toro_fixture.something') will fail in Laravel. grep -rn -- '->get(' src/ before you invest in porting.
  • Debugging autoload failures. composer why toro/fixture-bundle, then composer dump-autoload -o, then php -r "var_dump(class_exists('Toro\\FixtureBundle\\ToroFixtureBundle'));". If that returns false, your namespace guess is wrong — go back to autoload.psr-4.
  • Lockfile churn. Pulling this in as a dev dep can drag symfony/framework-bundle into a Laravel vendor/. Install on a branch and read the composer.lock diff before merging.
  • What is worth salvaging. The fixture interface (so your port keeps the same shape) and any dependency-ordering logic between fixtures. The container glue — bundle class, extension, commands — is not.
  • Laravel-native fallback. fakerphp/faker + model factories + seeders + RefreshDatabase covers the same ground with zero Symfony coupling and ongoing maintenance. Reach for this unless the bundle encodes non-trivial domain data you genuinely cannot re-express.
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.
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
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect